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