This repository has been archived by the owner on Feb 10, 2023. It is now read-only.
forked from percona/percona-server
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add remaining tests to mysql-test/suite/rocksdb. This fixes Issue #1
Two testcases are empty because RocksDB-SE doesn't support the feature: -autoincrement.test -autoinc_secondary.test
- Loading branch information
Showing
6 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# The test checks AUTO_INCREMENT capabilities that are not supported by RocksDB-SE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--echo # The test checks AUTO_INCREMENT capabilities that are not supported by RocksDB-SE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
DROP TABLE IF EXISTS t1; | ||
#--------------------------- | ||
# auto_increment_offset | ||
#--------------------------- | ||
SET auto_increment_offset = 200; | ||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb; | ||
INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c'); | ||
SELECT LAST_INSERT_ID(); | ||
LAST_INSERT_ID() | ||
1 | ||
SELECT a,b FROM t1 ORDER BY a; | ||
a b | ||
1 a | ||
2 b | ||
3 c | ||
#--------------------------- | ||
# auto_increment_increment | ||
#--------------------------- | ||
SET auto_increment_increment = 300; | ||
INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f'); | ||
SELECT LAST_INSERT_ID(); | ||
LAST_INSERT_ID() | ||
200 | ||
SELECT a,b FROM t1 ORDER BY a; | ||
a b | ||
1 a | ||
2 b | ||
3 c | ||
200 d | ||
500 e | ||
800 f | ||
SET auto_increment_increment = 50; | ||
INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i'); | ||
SELECT LAST_INSERT_ID(); | ||
LAST_INSERT_ID() | ||
850 | ||
SELECT a,b FROM t1 ORDER BY a; | ||
a b | ||
1 a | ||
2 b | ||
3 c | ||
200 d | ||
500 e | ||
800 f | ||
850 g | ||
900 h | ||
950 i | ||
DROP TABLE t1; | ||
#--------------------------- | ||
# offset is greater than the max value | ||
#--------------------------- | ||
SET auto_increment_increment = 500; | ||
SET auto_increment_offset = 300; | ||
CREATE TABLE t1 (a TINYINT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb; | ||
INSERT INTO t1 (a) VALUES (NULL); | ||
Warnings: | ||
Warning 1264 Out of range value for column 'a' at row 1 | ||
SELECT LAST_INSERT_ID(); | ||
LAST_INSERT_ID() | ||
127 | ||
SELECT a FROM t1 ORDER BY a; | ||
a | ||
127 | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# auto-increment-offset and auto-increment-increment | ||
# | ||
|
||
############################################ | ||
# TODO: | ||
# This test currently produces wrong result | ||
# on the line 36 of the result file and further | ||
# due to bug MySQL:47118. | ||
# When/if the bug is fixed, | ||
# the result will need to be updated | ||
############################################ | ||
|
||
--disable_warnings | ||
DROP TABLE IF EXISTS t1; | ||
--enable_warnings | ||
|
||
--echo #--------------------------- | ||
--echo # auto_increment_offset | ||
--echo #--------------------------- | ||
SET auto_increment_offset = 200; | ||
|
||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb; | ||
|
||
# If auto_increment_offset is greater than auto_increment_increment, | ||
# the offset is ignored | ||
|
||
INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c'); | ||
SELECT LAST_INSERT_ID(); | ||
SELECT a,b FROM t1 ORDER BY a; | ||
|
||
--echo #--------------------------- | ||
--echo # auto_increment_increment | ||
--echo #--------------------------- | ||
|
||
SET auto_increment_increment = 300; | ||
# offset should not be ignored anymore | ||
|
||
INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f'); | ||
SELECT LAST_INSERT_ID(); | ||
SELECT a,b FROM t1 ORDER BY a; | ||
|
||
SET auto_increment_increment = 50; | ||
INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i'); | ||
SELECT LAST_INSERT_ID(); | ||
SELECT a,b FROM t1 ORDER BY a; | ||
DROP TABLE t1; | ||
|
||
|
||
--echo #--------------------------- | ||
--echo # offset is greater than the max value | ||
--echo #--------------------------- | ||
|
||
SET auto_increment_increment = 500; | ||
SET auto_increment_offset = 300; | ||
|
||
CREATE TABLE t1 (a TINYINT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb; | ||
INSERT INTO t1 (a) VALUES (NULL); | ||
SELECT LAST_INSERT_ID(); | ||
SELECT a FROM t1 ORDER BY a; | ||
DROP TABLE t1; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# The test checks AUTO_INCREMENT capabilities that are not supported by RocksDB-SE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--echo # The test checks AUTO_INCREMENT capabilities that are not supported by RocksDB-SE. |