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_table.h | |
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_table.h')
-rw-r--r-- | sql/sql_table.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_table.h b/sql/sql_table.h index 6f09db12bb9..82f6dfb9658 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -105,6 +105,9 @@ enum enum_explain_filename_mode EXPLAIN_PARTITIONS_AS_COMMENT }; +/* Maximum length of GEOM_POINT Field */ +#define MAX_LEN_GEOM_POINT_FIELD 25 + /* depends on errmsg.txt Database `db`, Table `t` ... */ #define EXPLAIN_FILENAME_MAX_EXTRA_LENGTH 63 |