← Back
Editing: test_sql_2_sessions.result
# 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); 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)); 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); CREATE TABLE t_spec (c1 BIT(16), c2 ENUM('v1','v2','v3'), c3 SET('v1','v2','v3')); # 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'); SELECT * FROM t_int ; c1 c2 c3 c4 c5 c6 c7 c8 c9 91 92 93 94 95 96 97 98 99 81 82 83 84 85 86 87 88 89 SELECT * FROM t_bigint ; c1 c2 91 92 81 82 SELECT * FROM t_real; c1 c2 c3 c4 c5 c6 c7 c8 c9 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 SELECT * FROM t_date; c1 c2 c3 c4 c5 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 SELECT c3 FROM t_char; c3 varchar-text 2varchar-text SELECT c5,c6,c7,c8 FROM t_lob ; c5 c6 c7 c8 tinytext text mediumtext longtext 2tinytext 2text 2mediumtext 2longtext SELECT * FROM t_spec; c1 c2 c3 v1 v1 ########################################## # Run plugin ########################################## INSTALL PLUGIN test_sql_2_sessions SONAME 'TEST_SQL_2_SESSIONS'; ########################################## # Stop plugin ########################################## UNINSTALL PLUGIN test_sql_2_sessions; ########################################## # 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 ) (NOT_NULL BINARY TIMESTAMP ON_UPDATE_NOW ) (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 : ======================================================================== SELECT * FROM test.t_date Close Session 2 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 ) (NOT_NULL BINARY TIMESTAMP ON_UPDATE_NOW ) (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 : ======================================================================== SELECT * FROM test.t_date Close Session 2 deinit thread ########################################## # 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;
Save File
Cancel