| 1 |
# General not engine specific settings and requirements |
| 2 |
--source suite/gcol/inc/gcol_init_vars.pre |
| 3 |
|
| 4 |
# Skipping the test when binlog_format=STATEMENT due to unsafe statements: |
| 5 |
# unsafe auto-increment column, LIMIT clause. |
| 6 |
--source include/not_binlog_format_statement.inc |
| 7 |
|
| 8 |
################################################################################ |
| 9 |
# t/gcol_keys_innodb.test # |
| 10 |
# # |
| 11 |
# Purpose: # |
| 12 |
# Testing keys, indexes defined upon generated columns. # |
| 13 |
# # |
| 14 |
# InnoDB branch # |
| 15 |
# # |
| 16 |
#------------------------------------------------------------------------------# |
| 17 |
# Original Author: Andrey Zhakov # |
| 18 |
# Original Date: 2008-09-04 # |
| 19 |
# Change Author: # |
| 20 |
# Change Date: # |
| 21 |
# Change: # |
| 22 |
################################################################################ |
| 23 |
|
| 24 |
# |
| 25 |
# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! |
| 26 |
# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN |
| 27 |
# THE SOURCED FILES ONLY. |
| 28 |
# |
| 29 |
|
| 30 |
#------------------------------------------------------------------------------# |
| 31 |
|
| 32 |
#------------------------------------------------------------------------------# |
| 33 |
# Engine specific settings and requirements |
| 34 |
|
| 35 |
##### Storage engine to be tested |
| 36 |
# Set the session storage engine |
| 37 |
eval SET @@session.default_storage_engine = 'InnoDB'; |
| 38 |
|
| 39 |
##### Workarounds for known open engine specific bugs |
| 40 |
# none |
| 41 |
|
| 42 |
#------------------------------------------------------------------------------# |
| 43 |
# Execute the tests to be applied to all storage engines |
| 44 |
let $skip_spatial_index_check = 1; |
| 45 |
let $support_virtual_index= 1; |
| 46 |
--source suite/gcol/inc/gcol_keys.inc |
| 47 |
|
| 48 |
#------------------------------------------------------------------------------# |
| 49 |
# Execute storage engine specific tests |
| 50 |
--echo # |
| 51 |
--echo # BUG#21365158 WL8149:ASSERTION `!TABLE || (!TABLE->WRITE_SET |
| 52 |
--echo # |
| 53 |
CREATE TABLE t1 ( |
| 54 |
pk INTEGER AUTO_INCREMENT, |
| 55 |
col_int_nokey INTEGER NOT NULL, |
| 56 |
|
| 57 |
col_varchar_nokey VARCHAR(1) NOT NULL, |
| 58 |
col_varchar_key VARCHAR(2) GENERATED ALWAYS AS |
| 59 |
(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, |
| 60 |
|
| 61 |
PRIMARY KEY (pk) |
| 62 |
|
| 63 |
); |
| 64 |
|
| 65 |
INSERT INTO t1 ( col_int_nokey, col_varchar_nokey) |
| 66 |
VALUES (4, 'b'),(9, 'o'),(4, 'k'),(5, 'a'),(5, 'f'), |
| 67 |
(9, 't'),(3, 'c'),(8, 'c'),(0, 'r'),(98, 'k'); |
| 68 |
|
| 69 |
CREATE TABLE t2 ( |
| 70 |
pk INTEGER AUTO_INCREMENT, |
| 71 |
col_int_nokey INTEGER NOT NULL, |
| 72 |
|
| 73 |
col_varchar_nokey VARCHAR(1) NOT NULL, |
| 74 |
col_varchar_key VARCHAR(2) GENERATED ALWAYS AS |
| 75 |
(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, |
| 76 |
|
| 77 |
PRIMARY KEY (pk), |
| 78 |
UNIQUE KEY (col_varchar_key) |
| 79 |
|
| 80 |
); |
| 81 |
|
| 82 |
INSERT INTO t2 ( col_int_nokey, col_varchar_nokey) |
| 83 |
VALUES (1, 'c'),(8, 'm'),(9, 'd'), (6, 'y'),(1, 't'), |
| 84 |
(2, 's'),(4, 'r'); |
| 85 |
|
| 86 |
SELECT |
| 87 |
CONCAT( t2.col_varchar_nokey , t2.col_varchar_nokey ) AS f2, |
| 88 |
t1.col_varchar_key AS f5 |
| 89 |
FROM |
| 90 |
t2 LEFT JOIN t1 ON t2.col_int_nokey > t1.col_int_nokey |
| 91 |
ORDER BY f2, f5; |
| 92 |
DROP TABLE t1,t2; |
| 93 |
|
| 94 |
--echo # |
| 95 |
|
| 96 |
#------------------------------------------------------------------------------# |
| 97 |
# Cleanup |
| 98 |
--source suite/gcol/inc/gcol_cleanup.inc |