| 1 |
|
| 2 |
--echo # Creating tables |
| 3 |
CREATE TABLE t_int (c1 TINYINT, |
| 4 |
c2 SMALLINT, |
| 5 |
c3 MEDIUMINT, |
| 6 |
c4 INT, |
| 7 |
c5 INTEGER, |
| 8 |
c6 SMALLINT UNSIGNED, |
| 9 |
c7 MEDIUMINT UNSIGNED, |
| 10 |
c8 INT UNSIGNED, |
| 11 |
c9 INTEGER); |
| 12 |
|
| 13 |
CREATE TABLE t_bigint (c1 BIGINT, |
| 14 |
c2 BIGINT UNSIGNED); |
| 15 |
|
| 16 |
CREATE TABLE t_real (c1 REAL UNSIGNED, |
| 17 |
c2 DOUBLE UNSIGNED, |
| 18 |
c3 FLOAT UNSIGNED, |
| 19 |
c4 DECIMAL UNSIGNED, |
| 20 |
c5 NUMERIC UNSIGNED, |
| 21 |
c6 DOUBLE, |
| 22 |
c7 FLOAT, |
| 23 |
c8 DECIMAL, |
| 24 |
c9 NUMERIC); |
| 25 |
|
| 26 |
CREATE TABLE t_date (c1 DATE, |
| 27 |
c2 TIME, |
| 28 |
c3 TIMESTAMP, |
| 29 |
c4 DATETIME, |
| 30 |
c5 YEAR); |
| 31 |
|
| 32 |
CREATE TABLE t_char (c1 CHAR(32), |
| 33 |
c2 VARCHAR(128) BINARY, |
| 34 |
c3 VARCHAR(128), |
| 35 |
c4 BINARY(128), |
| 36 |
c5 VARBINARY(2048)); |
| 37 |
|
| 38 |
CREATE TABLE t_lob (c1 TINYBLOB, |
| 39 |
c2 BLOB, |
| 40 |
c3 MEDIUMBLOB, |
| 41 |
c4 LONGBLOB, |
| 42 |
c5 TINYTEXT, |
| 43 |
c6 TEXT, |
| 44 |
c7 MEDIUMTEXT, |
| 45 |
c8 LONGTEXT, |
| 46 |
c9 TINYTEXT BINARY, |
| 47 |
c10 TEXT BINARY, |
| 48 |
c11 MEDIUMTEXT BINARY, |
| 49 |
c12 LONGTEXT BINARY); |
| 50 |
|
| 51 |
CREATE TABLE t_spec (c1 BIT(16), |
| 52 |
c2 ENUM('v1','v2','v3'), |
| 53 |
c3 SET('v1','v2','v3')); |
| 54 |
|
| 55 |
--echo # Inserting values into the tables |
| 56 |
INSERT INTO t_int VALUES (91,92,93,94,95,96,97,98,99),(81,82,83,84,85,86,87,88,89); |
| 57 |
|
| 58 |
INSERT INTO t_bigint VALUES (91,92),(81,82); |
| 59 |
|
| 60 |
INSERT INTO t_real VALUES (8.51,8.52,8.53,8.54,8.55,8.56,8.57,8.58,8.59); |
| 61 |
|
| 62 |
INSERT INTO t_real VALUES (9.51,9.52,9.53,9.54,9.55,9.56,9.57,9.58,9.59); |
| 63 |
|
| 64 |
INSERT INTO t_date VALUES ('2015-07-06','20:15','2015-12-31 14:59:48','2014-11-30 13:58:47','2015'); |
| 65 |
|
| 66 |
INSERT INTO t_date VALUES ('2015-07-07','20:17','2013-12-31 17:59:47','2012-10-31 15:57:47','2010'); |
| 67 |
|
| 68 |
INSERT INTO t_char VALUES ('char-text','varchar-binary-text\nnext line','varchar-text','binary-text\nnext line','varbinary-text\nline 1\nline 2'); |
| 69 |
|
| 70 |
INSERT INTO t_char VALUES ('2char-text','2varchar-binary-text\nnext line','2varchar-text','2binary-text\nnext line','2varbinary-text\nline 1\nline 2'); |
| 71 |
|
| 72 |
INSERT INTO t_lob VALUES ('tinyblob-text readable','blob-text readable','mediumblob-text readable', |
| 73 |
'longblob-text readable','tinytext','text','mediumtext','longtext', |
| 74 |
'tinytext-binary\nnext line','text-binary\nnext line', |
| 75 |
'mediumtext-binary\nnext line','longtext-binary \nnext line'); |
| 76 |
|
| 77 |
INSERT INTO t_lob VALUES ('2tinyblob-text readable','2blob-text readable','2mediumblob-text readable', |
| 78 |
'2longblob-text readable','2tinytext','2text','2mediumtext','2longtext', |
| 79 |
'2tinytext-binary\nnext line','2text-binary\nnext line', |
| 80 |
'2mediumtext-binary\nnext line','2longtext-binary \nnext line'); |
| 81 |
|
| 82 |
INSERT INTO t_spec VALUES ( b'111', 'v1', 'v1'); |
| 83 |
|
| 84 |
SELECT * FROM t_int ; |
| 85 |
SELECT * FROM t_bigint ; |
| 86 |
SELECT * FROM t_real; |
| 87 |
SELECT * FROM t_date; |
| 88 |
|
| 89 |
# Only text columns are selected to avaoid not deterministinc results. |
| 90 |
SELECT c3 FROM t_char; |
| 91 |
|
| 92 |
# Only text columns are selected to avaoid not deterministinc results. |
| 93 |
SELECT c5,c6,c7,c8 FROM t_lob ; |
| 94 |
|
| 95 |
SELECT * FROM t_spec; |
| 96 |
|
| 97 |
--echo ########################################## |
| 98 |
--echo # Run plugin |
| 99 |
--echo ########################################## |
| 100 |
--replace_result $TEST_SQL_2_SESSIONS TEST_SQL_2_SESSIONS |
| 101 |
eval INSTALL PLUGIN test_sql_2_sessions SONAME '$TEST_SQL_2_SESSIONS'; |
| 102 |
|
| 103 |
--echo ########################################## |
| 104 |
--echo # Stop plugin |
| 105 |
--echo ########################################## |
| 106 |
UNINSTALL PLUGIN test_sql_2_sessions; |
| 107 |
|
| 108 |
--echo ########################################## |
| 109 |
--echo # Plugin log |
| 110 |
--echo ########################################## |
| 111 |
let $MYSQLD_DATADIR= `select @@datadir`; |
| 112 |
cat_file $MYSQLD_DATADIR/test_sql_2_sessions.log; |
| 113 |
remove_file $MYSQLD_DATADIR/test_sql_2_sessions.log; |
| 114 |
|
| 115 |
--echo ########################################## |
| 116 |
--echo # Cleanup |
| 117 |
--echo ########################################## |
| 118 |
|
| 119 |
--echo # Dropping the created tables |
| 120 |
DROP TABLE IF EXISTS t_int; |
| 121 |
DROP TABLE IF EXISTS t_bigint; |
| 122 |
DROP TABLE IF EXISTS t_real; |
| 123 |
DROP TABLE IF EXISTS t_date; |
| 124 |
DROP TABLE IF EXISTS t_char; |
| 125 |
DROP TABLE IF EXISTS t_lob; |
| 126 |
DROP TABLE IF EXISTS t_spec; |