How to define an empty polygon for a spatial column in MySQL?

I am trying to create a spatial index above a table column ( bbox polygon default NULL ), but get an error: All parts of a SPATIAL index must be NOT NULL .

The problem is that I assumed that some lines would contain NULL. The question is: is there a way to declare a column with an empty polygon by default?

+6
source share
1 answer

Just define the NOT NULL column and not the default.

spatial columns have an implicit default value of 'empty'.

Unfortunately, because you get a paste warning saying that there is no default value; but you also have an explicit default value.

0
source

Source: https://habr.com/ru/post/899206/


All Articles