| 1 |
call mtr.add_suppression(".*test_sql_errors.*"); |
| 2 |
call mtr.add_suppression(".*Killing thread.*"); |
| 3 |
# Creating tables |
| 4 |
CREATE TABLE t_int (c1 TINYINT, |
| 5 |
c2 SMALLINT, |
| 6 |
c3 MEDIUMINT, |
| 7 |
c4 INT, |
| 8 |
c5 INTEGER, |
| 9 |
c6 SMALLINT UNSIGNED, |
| 10 |
c7 MEDIUMINT UNSIGNED, |
| 11 |
c8 INT UNSIGNED, |
| 12 |
c9 INTEGER); |
| 13 |
CREATE TABLE t_bigint (c1 BIGINT, |
| 14 |
c2 BIGINT UNSIGNED); |
| 15 |
CREATE TABLE t_real (c1 REAL UNSIGNED, |
| 16 |
c2 DOUBLE UNSIGNED, |
| 17 |
c3 FLOAT UNSIGNED, |
| 18 |
c4 DECIMAL UNSIGNED, |
| 19 |
c5 NUMERIC UNSIGNED, |
| 20 |
c6 DOUBLE, |
| 21 |
c7 FLOAT, |
| 22 |
c8 DECIMAL, |
| 23 |
c9 NUMERIC); |
| 24 |
Warnings: |
| 25 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 26 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 27 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 28 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 29 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 30 |
CREATE TABLE t_date (c1 DATE, |
| 31 |
c2 TIME, |
| 32 |
c3 TIMESTAMP, |
| 33 |
c4 DATETIME, |
| 34 |
c5 YEAR); |
| 35 |
CREATE TABLE t_char (c1 CHAR(32), |
| 36 |
c2 VARCHAR(128) BINARY, |
| 37 |
c3 VARCHAR(128), |
| 38 |
c4 BINARY(128), |
| 39 |
c5 VARBINARY(2048)); |
| 40 |
Warnings: |
| 41 |
Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead |
| 42 |
CREATE TABLE t_lob (c1 TINYBLOB, |
| 43 |
c2 BLOB, |
| 44 |
c3 MEDIUMBLOB, |
| 45 |
c4 LONGBLOB, |
| 46 |
c5 TINYTEXT, |
| 47 |
c6 TEXT, |
| 48 |
c7 MEDIUMTEXT, |
| 49 |
c8 LONGTEXT, |
| 50 |
c9 TINYTEXT BINARY, |
| 51 |
c10 TEXT BINARY, |
| 52 |
c11 MEDIUMTEXT BINARY, |
| 53 |
c12 LONGTEXT BINARY); |
| 54 |
Warnings: |
| 55 |
Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead |
| 56 |
Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead |
| 57 |
Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead |
| 58 |
Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead |
| 59 |
CREATE TABLE t_spec (c1 BIT(16), |
| 60 |
c2 ENUM('v1','v2','v3'), |
| 61 |
c3 SET('v1','v2','v3')); |
| 62 |
SET @orig_log_error_verbosity= @@GLOBAL.log_error_verbosity; |
| 63 |
SET GLOBAL log_error_verbosity=3; |
| 64 |
# Inserting values into the tables |
| 65 |
INSERT INTO t_int VALUES (91,92,93,94,95,96,97,98,99),(81,82,83,84,85,86,87,88,89); |
| 66 |
INSERT INTO t_bigint VALUES (91,92),(81,82); |
| 67 |
INSERT INTO t_real VALUES (8.51,8.52,8.53,8.54,8.55,8.56,8.57,8.58,8.59); |
| 68 |
Warnings: |
| 69 |
Note 1265 Data truncated for column 'c4' at row 1 |
| 70 |
Note 1265 Data truncated for column 'c5' at row 1 |
| 71 |
Note 1265 Data truncated for column 'c8' at row 1 |
| 72 |
Note 1265 Data truncated for column 'c9' at row 1 |
| 73 |
INSERT INTO t_real VALUES (9.51,9.52,9.53,9.54,9.55,9.56,9.57,9.58,9.59); |
| 74 |
Warnings: |
| 75 |
Note 1265 Data truncated for column 'c4' at row 1 |
| 76 |
Note 1265 Data truncated for column 'c5' at row 1 |
| 77 |
Note 1265 Data truncated for column 'c8' at row 1 |
| 78 |
Note 1265 Data truncated for column 'c9' at row 1 |
| 79 |
INSERT INTO t_date VALUES ('2015-07-06','20:15','2015-12-31 14:59:48','2014-11-30 13:58:47','2015'); |
| 80 |
INSERT INTO t_date VALUES ('2015-07-07','20:17','2013-12-31 17:59:47','2012-10-31 15:57:47','2010'); |
| 81 |
INSERT INTO t_char VALUES ('char-text','varchar-binary-text\nnext line','varchar-text','binary-text\nnext line','varbinary-text\nline 1\nline 2'); |
| 82 |
INSERT INTO t_char VALUES ('2char-text','2varchar-binary-text\nnext line','2varchar-text','2binary-text\nnext line','2varbinary-text\nline 1\nline 2'); |
| 83 |
INSERT INTO t_lob VALUES ('tinyblob-text readable','blob-text readable','mediumblob-text readable', |
| 84 |
'longblob-text readable','tinytext','text','mediumtext','longtext', |
| 85 |
'tinytext-binary\nnext line','text-binary\nnext line', |
| 86 |
'mediumtext-binary\nnext line','longtext-binary \nnext line'); |
| 87 |
INSERT INTO t_lob VALUES ('2tinyblob-text readable','2blob-text readable','2mediumblob-text readable', |
| 88 |
'2longblob-text readable','2tinytext','2text','2mediumtext','2longtext', |
| 89 |
'2tinytext-binary\nnext line','2text-binary\nnext line', |
| 90 |
'2mediumtext-binary\nnext line','2longtext-binary \nnext line'); |
| 91 |
INSERT INTO t_spec VALUES ( b'111', 'v1', 'v1'); |
| 92 |
########################################## |
| 93 |
# Run plugin |
| 94 |
########################################## |
| 95 |
INSTALL PLUGIN test_sql_errors SONAME 'TEST_SQL_ERRORS'; |
| 96 |
/*first*/SELECT * FROM information_schema.processlist ORDER BY id; |
| 97 |
ID USER HOST DB COMMAND TIME STATE INFO |
| 98 |
<ID> event_scheduler <HOST_NAME> NULL Daemon <TIME> Waiting on empty queue NULL |
| 99 |
<ID> root <HOST_NAME> test Query <TIME> executing /*first*/SELECT * FROM information_schema.processlist ORDER BY id |
| 100 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 101 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 102 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 103 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 104 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 105 |
Warnings: |
| 106 |
<ID> 1287 <HOST_NAME> |
| 107 |
########################################## |
| 108 |
# Stop plugin |
| 109 |
########################################## |
| 110 |
UNINSTALL PLUGIN test_sql_errors; |
| 111 |
/*first*/SELECT * FROM information_schema.processlist ORDER BY id; |
| 112 |
ID USER HOST DB COMMAND TIME STATE INFO |
| 113 |
<ID> event_scheduler <HOST_NAME> NULL Daemon <TIME> Waiting on empty queue NULL |
| 114 |
<ID> root <HOST_NAME> test Query <TIME> executing /*first*/SELECT * FROM information_schema.processlist ORDER BY id |
| 115 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 116 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 117 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 118 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 119 |
<ID> unauthenticated user <HOST_NAME> NULL Sleep <TIME> login PLUGIN |
| 120 |
Warnings: |
| 121 |
<ID> 1287 <HOST_NAME> |
| 122 |
########################################## |
| 123 |
# Cleanup |
| 124 |
########################################## |
| 125 |
# Dropping the created tables |
| 126 |
DROP TABLE IF EXISTS t_int; |
| 127 |
DROP TABLE IF EXISTS t_bigint; |
| 128 |
DROP TABLE IF EXISTS t_real; |
| 129 |
DROP TABLE IF EXISTS t_date; |
| 130 |
DROP TABLE IF EXISTS t_char; |
| 131 |
DROP TABLE IF EXISTS t_lob; |
| 132 |
DROP TABLE IF EXISTS t_spec; |
| 133 |
########################################## |
| 134 |
# Plugin log |
| 135 |
########################################## |
| 136 |
======================================================================== |
| 137 |
Test in a server thread |
| 138 |
Opening Session 1 |
| 139 |
======================================================================== |
| 140 |
Session 1 : |
| 141 |
======================================================================== |
| 142 |
SELECT * FROM test.t_int |
| 143 |
num_cols: 9 |
| 144 |
nb rows: 2 |
| 145 |
c1 c2 c3 c4 c5 c6 c7 c8 c9 |
| 146 |
TINY(1) SHORT(2) INT24(9) LONG(3) LONG(3) SHORT(2) INT24(9) LONG(3) LONG(3) |
| 147 |
() () () () () (UNSIGNED ) (UNSIGNED ) (UNSIGNED ) () |
| 148 |
Write a string |
| 149 |
91 92 93 94 95 96 97 98 99 |
| 150 |
81 82 83 84 85 86 87 88 89 |
| 151 |
|
| 152 |
affected rows : 0 |
| 153 |
server status : 34 |
| 154 |
warn count : 0 |
| 155 |
|
| 156 |
Opening Session 2 |
| 157 |
======================================================================== |
| 158 |
Session 1 : |
| 159 |
======================================================================== |
| 160 |
SELECT * FROM test.t_bigint |
| 161 |
num_cols: 2 |
| 162 |
nb rows: 2 |
| 163 |
c1 c2 |
| 164 |
LONGLONG(8) LONGLONG(8) |
| 165 |
() (UNSIGNED ) |
| 166 |
Write a string |
| 167 |
91 92 |
| 168 |
81 82 |
| 169 |
|
| 170 |
affected rows : 0 |
| 171 |
server status : 34 |
| 172 |
warn count : 0 |
| 173 |
======================================================================== |
| 174 |
Session 2 : |
| 175 |
======================================================================== |
| 176 |
SELECT * FROM test.t_real |
| 177 |
num_cols: 9 |
| 178 |
nb rows: 2 |
| 179 |
c1 c2 c3 c4 c5 c6 c7 c8 c9 |
| 180 |
DOUBLE(5) DOUBLE(5) FLOAT(4) NEWDECIMAL(246) NEWDECIMAL(246) DOUBLE(5) FLOAT(4) NEWDECIMAL(246) NEWDECIMAL(246) |
| 181 |
(UNSIGNED ) (UNSIGNED ) (UNSIGNED ) (UNSIGNED ) (UNSIGNED ) () () () () |
| 182 |
Write a string |
| 183 |
8.51 8.52 8.53 9 9 8.56 8.57 9 9 |
| 184 |
9.51 9.52 9.53 10 10 9.56 9.57 10 10 |
| 185 |
|
| 186 |
affected rows : 0 |
| 187 |
server status : 34 |
| 188 |
warn count : 0 |
| 189 |
|
| 190 |
Close Session 1 |
| 191 |
======================================================================== |
| 192 |
Session 2 : |
| 193 |
======================================================================== |
| 194 |
SELECT * FROM test.t_date |
| 195 |
num_cols: 5 |
| 196 |
nb rows: 2 |
| 197 |
c1 c2 c3 c4 c5 |
| 198 |
DATE(10) TIME(11) TIMESTAMP(7) DATETIME(12) YEAR(13) |
| 199 |
(BINARY ) (BINARY ) (BINARY ) (BINARY ) (UNSIGNED ZEROFILL ) |
| 200 |
Write a string |
| 201 |
2015-07-06 20:15:00 2015-12-31 14:59:48 2014-11-30 13:58:47 2015 |
| 202 |
2015-07-07 20:17:00 2013-12-31 17:59:47 2012-10-31 15:57:47 2010 |
| 203 |
|
| 204 |
affected rows : 0 |
| 205 |
server status : 34 |
| 206 |
warn count : 0 |
| 207 |
======================================================================== |
| 208 |
Session 1 (already closed): |
| 209 |
======================================================================== |
| 210 |
SELECT * FROM test.t_date |
| 211 |
|
| 212 |
Close Session 2 |
| 213 |
|
| 214 |
Close Session 2 again |
| 215 |
Follows threaded run |
| 216 |
======================================================================== |
| 217 |
init thread |
| 218 |
Opening Session 1 |
| 219 |
======================================================================== |
| 220 |
Session 1 : |
| 221 |
======================================================================== |
| 222 |
SELECT * FROM test.t_int |
| 223 |
num_cols: 9 |
| 224 |
nb rows: 2 |
| 225 |
c1 c2 c3 c4 c5 c6 c7 c8 c9 |
| 226 |
TINY(1) SHORT(2) INT24(9) LONG(3) LONG(3) SHORT(2) INT24(9) LONG(3) LONG(3) |
| 227 |
() () () () () (UNSIGNED ) (UNSIGNED ) (UNSIGNED ) () |
| 228 |
Write a string |
| 229 |
91 92 93 94 95 96 97 98 99 |
| 230 |
81 82 83 84 85 86 87 88 89 |
| 231 |
|
| 232 |
affected rows : 0 |
| 233 |
server status : 34 |
| 234 |
warn count : 0 |
| 235 |
|
| 236 |
Opening Session 2 |
| 237 |
======================================================================== |
| 238 |
Session 1 : |
| 239 |
======================================================================== |
| 240 |
SELECT * FROM test.t_bigint |
| 241 |
num_cols: 2 |
| 242 |
nb rows: 2 |
| 243 |
c1 c2 |
| 244 |
LONGLONG(8) LONGLONG(8) |
| 245 |
() (UNSIGNED ) |
| 246 |
Write a string |
| 247 |
91 92 |
| 248 |
81 82 |
| 249 |
|
| 250 |
affected rows : 0 |
| 251 |
server status : 34 |
| 252 |
warn count : 0 |
| 253 |
======================================================================== |
| 254 |
Session 2 : |
| 255 |
======================================================================== |
| 256 |
SELECT * FROM test.t_real |
| 257 |
num_cols: 9 |
| 258 |
nb rows: 2 |
| 259 |
c1 c2 c3 c4 c5 c6 c7 c8 c9 |
| 260 |
DOUBLE(5) DOUBLE(5) FLOAT(4) NEWDECIMAL(246) NEWDECIMAL(246) DOUBLE(5) FLOAT(4) NEWDECIMAL(246) NEWDECIMAL(246) |
| 261 |
(UNSIGNED ) (UNSIGNED ) (UNSIGNED ) (UNSIGNED ) (UNSIGNED ) () () () () |
| 262 |
Write a string |
| 263 |
8.51 8.52 8.53 9 9 8.56 8.57 9 9 |
| 264 |
9.51 9.52 9.53 10 10 9.56 9.57 10 10 |
| 265 |
|
| 266 |
affected rows : 0 |
| 267 |
server status : 34 |
| 268 |
warn count : 0 |
| 269 |
|
| 270 |
Close Session 1 |
| 271 |
======================================================================== |
| 272 |
Session 2 : |
| 273 |
======================================================================== |
| 274 |
SELECT * FROM test.t_date |
| 275 |
num_cols: 5 |
| 276 |
nb rows: 2 |
| 277 |
c1 c2 c3 c4 c5 |
| 278 |
DATE(10) TIME(11) TIMESTAMP(7) DATETIME(12) YEAR(13) |
| 279 |
(BINARY ) (BINARY ) (BINARY ) (BINARY ) (UNSIGNED ZEROFILL ) |
| 280 |
Write a string |
| 281 |
2015-07-06 20:15:00 2015-12-31 14:59:48 2014-11-30 13:58:47 2015 |
| 282 |
2015-07-07 20:17:00 2013-12-31 17:59:47 2012-10-31 15:57:47 2010 |
| 283 |
|
| 284 |
affected rows : 0 |
| 285 |
server status : 34 |
| 286 |
warn count : 0 |
| 287 |
======================================================================== |
| 288 |
Session 1 (already closed): |
| 289 |
======================================================================== |
| 290 |
SELECT * FROM test.t_date |
| 291 |
|
| 292 |
Close Session 2 |
| 293 |
|
| 294 |
Close Session 2 again |
| 295 |
Test in a server thread without closing sessions |
| 296 |
srv_session_open 0 |
| 297 |
srv_session_open 1 |
| 298 |
srv_session_open 2 |
| 299 |
srv_session_open 3 |
| 300 |
srv_session_open 4 |
| 301 |
########################################## |
| 302 |
# Server log |
| 303 |
########################################## |
| 304 |
test passed. |
| 305 |
SET GLOBAL log_error_verbosity= @orig_log_error_verbosity; |