Commit f36c0189 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-17544: No warning when trying to name a primary key constraint

Part#2: update .result files for affected MyRocks tests
parent 4c4e379b
drop table if exists t1; drop table if exists t1;
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY ka(a)) ENGINE=RocksDB; CREATE TABLE t1 (a INT, b INT, PRIMARY KEY ka(a)) ENGINE=RocksDB;
Warnings:
Warning 1280 Name 'ka' ignored for PRIMARY key.
INSERT INTO t1 (a, b) VALUES (1, 5); INSERT INTO t1 (a, b) VALUES (1, 5);
INSERT INTO t1 (a, b) VALUES (2, 6); INSERT INTO t1 (a, b) VALUES (2, 6);
INSERT INTO t1 (a, b) VALUES (3, 7); INSERT INTO t1 (a, b) VALUES (3, 7);
...@@ -15,6 +17,8 @@ t1 CREATE TABLE `t1` ( ...@@ -15,6 +17,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 ) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY ka(a)) ENGINE=RocksDB; CREATE TABLE t1 (a INT, b INT, PRIMARY KEY ka(a)) ENGINE=RocksDB;
Warnings:
Warning 1280 Name 'ka' ignored for PRIMARY key.
INSERT INTO t1 (a, b) VALUES (1, 5); INSERT INTO t1 (a, b) VALUES (1, 5);
INSERT INTO t1 (a, b) VALUES (2, 6); INSERT INTO t1 (a, b) VALUES (2, 6);
INSERT INTO t1 (a, b) VALUES (3, 7); INSERT INTO t1 (a, b) VALUES (3, 7);
...@@ -38,6 +42,8 @@ a b ...@@ -38,6 +42,8 @@ a b
5 8 5 8
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY ka(a)) ENGINE=RocksDB; CREATE TABLE t1 (a INT, b INT, PRIMARY KEY ka(a)) ENGINE=RocksDB;
Warnings:
Warning 1280 Name 'ka' ignored for PRIMARY key.
INSERT INTO t1 (a, b) VALUES (1, 5); INSERT INTO t1 (a, b) VALUES (1, 5);
INSERT INTO t1 (a, b) VALUES (2, NULL); INSERT INTO t1 (a, b) VALUES (2, NULL);
INSERT INTO t1 (a, b) VALUES (3, NULL); INSERT INTO t1 (a, b) VALUES (3, NULL);
...@@ -56,6 +62,8 @@ COUNT(*) ...@@ -56,6 +62,8 @@ COUNT(*)
4 4
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, c INT, PRIMARY KEY ka(a)) ENGINE=RocksDB; CREATE TABLE t1 (a INT, b INT, c INT, PRIMARY KEY ka(a)) ENGINE=RocksDB;
Warnings:
Warning 1280 Name 'ka' ignored for PRIMARY key.
INSERT INTO t1 (a,b,c) VALUES (1,1,NULL); INSERT INTO t1 (a,b,c) VALUES (1,1,NULL);
INSERT INTO t1 (a,b,c) VALUES (2,1,NULL); INSERT INTO t1 (a,b,c) VALUES (2,1,NULL);
INSERT INTO t1 (a,b,c) VALUES (3,1,NULL); INSERT INTO t1 (a,b,c) VALUES (3,1,NULL);
......
...@@ -8,6 +8,8 @@ m MEDIUMBLOB, ...@@ -8,6 +8,8 @@ m MEDIUMBLOB,
l LONGBLOB, l LONGBLOB,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
SHOW INDEX IN t1; SHOW INDEX IN t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 b A 1000 32 NULL LSMTREE t1 0 PRIMARY 1 b A 1000 32 NULL LSMTREE
...@@ -133,6 +135,8 @@ CREATE TABLE t1 ( ...@@ -133,6 +135,8 @@ CREATE TABLE t1 (
b BLOB, b BLOB,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
...@@ -147,6 +151,8 @@ CREATE TABLE t1 ( ...@@ -147,6 +151,8 @@ CREATE TABLE t1 (
b TINYBLOB, b TINYBLOB,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
...@@ -161,6 +167,8 @@ CREATE TABLE t1 ( ...@@ -161,6 +167,8 @@ CREATE TABLE t1 (
b MEDIUMBLOB, b MEDIUMBLOB,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
...@@ -175,6 +183,8 @@ CREATE TABLE t1 ( ...@@ -175,6 +183,8 @@ CREATE TABLE t1 (
b LONGBLOB, b LONGBLOB,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
......
...@@ -8,6 +8,8 @@ m MEDIUMTEXT, ...@@ -8,6 +8,8 @@ m MEDIUMTEXT,
l LONGTEXT, l LONGTEXT,
PRIMARY KEY t (t(32)) PRIMARY KEY t (t(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 't' ignored for PRIMARY key.
SHOW INDEX IN t1; SHOW INDEX IN t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 t A 1000 32 NULL LSMTREE t1 0 PRIMARY 1 t A 1000 32 NULL LSMTREE
...@@ -55,6 +57,8 @@ pk MEDIUMTEXT, ...@@ -55,6 +57,8 @@ pk MEDIUMTEXT,
PRIMARY KEY mt (pk(1)), PRIMARY KEY mt (pk(1)),
INDEX (m(128)) INDEX (m(128))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'mt' ignored for PRIMARY key.
SHOW INDEX IN t1; SHOW INDEX IN t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 pk A 1000 1 NULL LSMTREE t1 0 PRIMARY 1 pk A 1000 1 NULL LSMTREE
...@@ -80,6 +84,8 @@ CREATE TABLE t1 ( ...@@ -80,6 +84,8 @@ CREATE TABLE t1 (
b TEXT, b TEXT,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
...@@ -94,6 +100,8 @@ CREATE TABLE t1 ( ...@@ -94,6 +100,8 @@ CREATE TABLE t1 (
b TINYTEXT, b TINYTEXT,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
...@@ -108,6 +116,8 @@ CREATE TABLE t1 ( ...@@ -108,6 +116,8 @@ CREATE TABLE t1 (
b MEDIUMTEXT, b MEDIUMTEXT,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
...@@ -122,6 +132,8 @@ CREATE TABLE t1 ( ...@@ -122,6 +132,8 @@ CREATE TABLE t1 (
b LONGTEXT, b LONGTEXT,
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
...@@ -136,6 +148,8 @@ CREATE TABLE t1 ( ...@@ -136,6 +148,8 @@ CREATE TABLE t1 (
b LONGTEXT CHARACTER SET "binary" COLLATE "binary", b LONGTEXT CHARACTER SET "binary" COLLATE "binary",
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES INSERT INTO t1 (b) VALUES
('00000000000000000000000000000000'), ('00000000000000000000000000000000'),
('00000000000000000000000000000001'), ('00000000000000000000000000000001'),
...@@ -154,6 +168,8 @@ CREATE TABLE t1 ( ...@@ -154,6 +168,8 @@ CREATE TABLE t1 (
b LONGTEXT CHARACTER SET "latin1" COLLATE "latin1_bin", b LONGTEXT CHARACTER SET "latin1" COLLATE "latin1_bin",
PRIMARY KEY b (b(32)) PRIMARY KEY b (b(32))
) ENGINE=rocksdb; ) ENGINE=rocksdb;
Warnings:
Warning 1280 Name 'b' ignored for PRIMARY key.
INSERT INTO t1 (b) VALUES (''), (_binary 0x0), (' '); INSERT INTO t1 (b) VALUES (''), (_binary 0x0), (' ');
ERROR 23000: Duplicate entry ' ' for key 'PRIMARY' ERROR 23000: Duplicate entry ' ' for key 'PRIMARY'
INSERT INTO t1 (b) VALUES (''), (_binary 0x0); INSERT INTO t1 (b) VALUES (''), (_binary 0x0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment