diff options
author | Raghav Kapoor <raghav.kapoor@oracle.com> | 2014-06-25 18:06:28 +0530 |
---|---|---|
committer | Raghav Kapoor <raghav.kapoor@oracle.com> | 2014-06-25 18:06:28 +0530 |
commit | cdf72d51c631aecb46505ff94cdb9ef667d4444c (patch) | |
tree | e8010dce623c94162e25a3479aa7d290baaf0132 /sql/sql_yacc.yy | |
parent | d63645c890550cc190416e2c90585c1c6903b529 (diff) | |
download | mariadb-git-cdf72d51c631aecb46505ff94cdb9ef667d4444c.tar.gz |
BUG#17665767 - FAILING ASSERTION: PRIMARY_KEY_NO == -1 || PRIMARY_KEY_NO == 0
BACKGROUND:
This bug is a followup on Bug#16368875.
The assertion failure happens because in SQL layer the key
does not get promoted to PRIMARY KEY but InnoDB takes it
as PRIMARY KEY.
ANALYSIS:
Here we are trying to create an index on POINT (GEOMETRY)
data type which is a type of BLOB (since GEOMETRY is a
subclass of BLOB).
In general, we can't create an index over GEOMETRY family
type field unless we specify the length of the
keypart (similar to BLOB fields).
Only exception is the POINT field type. The POINT column
max size is 25. The problem is that the field is not treated
as PRIMARY KEY when we create a index on POINT column using
its max column size as key part prefix. The fix would allow
index on POINT column to be treated as PRIMARY KEY.
FIX:
Patch for Bug#16368875 is extended to take into account
GEOMETRY datatype, POINT in particular to consider it
as PRIMARY KEY in SQL layer.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index bd5d4dc5604..74a21c9f6b6 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5603,7 +5603,8 @@ spatial_type: | GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; } | POINT_SYM { - Lex->length= (char*)"25"; + Lex->length= const_cast<char*>(STRINGIFY_ARG + (MAX_LEN_GEOM_POINT_FIELD)); $$= Field::GEOM_POINT; } | MULTIPOINT { $$= Field::GEOM_MULTIPOINT; } |