Description:
When used as UNIQUE or PRIMARY KEY RTREE allows duplicates without any error.
This causes mysqld crash indifferent places - one of them reported in original email
In example below I tried to insert several rows untill at row 86 mysqld crashed at:
myisam/rt_split.c:80
static double count_square(
...
square *= a[1] - a[0];
mysqld also crashes with:
DELETE FROM rt WHERE a<1;
causes crash at:
myisam/mi_key.c:215
uint _mi_pack_key()
...
while (length--)
{
*key++ = *--pos;
...
How to repeat:
mysql> CREATE TABLE `rt` (
-> `a` int(11) NOT NULL default '0',
-> `b` int(11) NOT NULL default '0',
-> UNIQUE KEY `a` USING RTREE (`a`,`b`)
-> ) TYPE=MyISAM CHARSET=latin1;
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT INTO rt VALUES (1,1),(1,1);
Query OK, 2 rows affected (0.04 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from rt;
+---+---+
| a | b |
+---+---+
| 1 | 1 |
| 1 | 1 |
+---+---+
mysql> CREATE TABLE `rt` (
-> `a` int(11) NOT NULL default '0',
-> `b` int(11) NOT NULL default '0',
-> PRIMARY KEY `a` USING RTREE (`a`, `b`)
-> ) TYPE=MyISAM CHARSET=latin1;
Query OK, 0 rows affected (0.02 sec)
mysql> INSERT INTO rt VALUES (1,1),(1,1);
Query OK, 2 rows affected (0.03 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from rt;
+---+---+
| a | b |
+---+---+
| 1 | 1 |
| 1 | 1 |
+---+---+
Description: When used as UNIQUE or PRIMARY KEY RTREE allows duplicates without any error. This causes mysqld crash indifferent places - one of them reported in original email In example below I tried to insert several rows untill at row 86 mysqld crashed at: myisam/rt_split.c:80 static double count_square( ... square *= a[1] - a[0]; mysqld also crashes with: DELETE FROM rt WHERE a<1; causes crash at: myisam/mi_key.c:215 uint _mi_pack_key() ... while (length--) { *key++ = *--pos; ... How to repeat: mysql> CREATE TABLE `rt` ( -> `a` int(11) NOT NULL default '0', -> `b` int(11) NOT NULL default '0', -> UNIQUE KEY `a` USING RTREE (`a`,`b`) -> ) TYPE=MyISAM CHARSET=latin1; Query OK, 0 rows affected (0.03 sec) mysql> INSERT INTO rt VALUES (1,1),(1,1); Query OK, 2 rows affected (0.04 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> select * from rt; +---+---+ | a | b | +---+---+ | 1 | 1 | | 1 | 1 | +---+---+ mysql> CREATE TABLE `rt` ( -> `a` int(11) NOT NULL default '0', -> `b` int(11) NOT NULL default '0', -> PRIMARY KEY `a` USING RTREE (`a`, `b`) -> ) TYPE=MyISAM CHARSET=latin1; Query OK, 0 rows affected (0.02 sec) mysql> INSERT INTO rt VALUES (1,1),(1,1); Query OK, 2 rows affected (0.03 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> select * from rt; +---+---+ | a | b | +---+---+ | 1 | 1 | | 1 | 1 | +---+---+