MDEV-16534 PPC64: Unexpected error with a negative value into auto-increment columns in HEAP, MyISAM, ARIA
This commit is contained in:
parent
15b92915ed
commit
170b43c156
@ -537,3 +537,32 @@ pk
|
|||||||
-5
|
-5
|
||||||
1
|
1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# Start of 5.5 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` char(30) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id name
|
||||||
|
-1 dog
|
||||||
|
2 cat
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 5.5 tests
|
||||||
|
#
|
||||||
|
@ -39,3 +39,32 @@ _rowid _rowid skey sval
|
|||||||
1 1 1 hello
|
1 1 1 hello
|
||||||
2 2 2 hey
|
2 2 2 hey
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# Start of 5.5 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` char(30) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id name
|
||||||
|
-1 dog
|
||||||
|
2 cat
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 5.5 tests
|
||||||
|
#
|
||||||
|
@ -33,3 +33,28 @@ select _rowid,t1._rowid,skey,sval from t1;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Start of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
@ -2697,3 +2697,32 @@ ALTER TABLE t1 DISABLE KEYS;
|
|||||||
INSERT INTO t1 (b) VALUES ('');
|
INSERT INTO t1 (b) VALUES ('');
|
||||||
ALTER TABLE t1 ENABLE KEYS;
|
ALTER TABLE t1 ENABLE KEYS;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# Start of 5.5 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=ARIA;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` char(30) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id name
|
||||||
|
-1 dog
|
||||||
|
2 cat
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 5.5 tests
|
||||||
|
#
|
||||||
|
@ -1990,3 +1990,28 @@ aria_page_checksum=$default_checksum,
|
|||||||
aria_log_file_size=$default_log_file_size;
|
aria_log_file_size=$default_log_file_size;
|
||||||
--enable_result_log
|
--enable_result_log
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Start of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=ARIA;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
@ -397,3 +397,28 @@ insert into t1 values(null);
|
|||||||
select last_insert_id();
|
select last_insert_id();
|
||||||
select * from t1;
|
select * from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Start of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
@ -1012,7 +1012,7 @@ void heap_update_auto_increment(HP_INFO *info, const uchar *record)
|
|||||||
|
|
||||||
switch (info->s->auto_key_type) {
|
switch (info->s->auto_key_type) {
|
||||||
case HA_KEYTYPE_INT8:
|
case HA_KEYTYPE_INT8:
|
||||||
s_value= (longlong) *(char*)key;
|
s_value= (longlong) *(const signed char*) key;
|
||||||
break;
|
break;
|
||||||
case HA_KEYTYPE_BINARY:
|
case HA_KEYTYPE_BINARY:
|
||||||
value=(ulonglong) *(uchar*) key;
|
value=(ulonglong) *(uchar*) key;
|
||||||
|
@ -728,7 +728,7 @@ ulonglong ma_retrieve_auto_increment(const uchar *key, uint8 key_type)
|
|||||||
|
|
||||||
switch (key_type) {
|
switch (key_type) {
|
||||||
case HA_KEYTYPE_INT8:
|
case HA_KEYTYPE_INT8:
|
||||||
s_value= (longlong) *(const char*)key;
|
s_value= (longlong) *(const signed char*) key;
|
||||||
break;
|
break;
|
||||||
case HA_KEYTYPE_BINARY:
|
case HA_KEYTYPE_BINARY:
|
||||||
value=(ulonglong) *key;
|
value=(ulonglong) *key;
|
||||||
|
@ -553,7 +553,7 @@ ulonglong retrieve_auto_increment(MI_INFO *info,const uchar *record)
|
|||||||
|
|
||||||
switch (keyseg->type) {
|
switch (keyseg->type) {
|
||||||
case HA_KEYTYPE_INT8:
|
case HA_KEYTYPE_INT8:
|
||||||
s_value= (longlong) *(char*)key;
|
s_value= (longlong) *(const signed char*) key;
|
||||||
break;
|
break;
|
||||||
case HA_KEYTYPE_BINARY:
|
case HA_KEYTYPE_BINARY:
|
||||||
value=(ulonglong) *(uchar*) key;
|
value=(ulonglong) *(uchar*) key;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user