Details
-
Task
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Generated columns are always created as nullable. This is not necessarily correct, the server could deduce the nullability of the generated column from its generating expression.
Making them NOT NULL as appropriate would simplify optimization in some cases and would allow creating, for example, SPATIAL indexes over generated columns.
I don't have the details of error reported , but i remember server complaining about unique index
The workaround was to materialized the GEOM column not using virtual column :
alter table zip_all add column coord point not null
update zip_all set coord = POINT(lat,lon);
alter table zip_all_bis ADD SPATIAL INDEX(coord)
Attachments
Issue Links
- duplicates
-
MDEV-12384 Cannot create SPATIAL/RTREE index on virtual column
- Closed
- relates to
-
MDEV-10964 Support for NULL/NOT NULL syntax for virtual columns
- Open
- links to