Commit ca585802 authored by Alexander Barkov's avatar Alexander Barkov

Adding tests for the bug

"TABLE_TYPE=ini does not clear memory between CREATE TABLEs"
fixed by Olivier.

modified:
  mysql-test/suite/connect/r/ini.result
  mysql-test/suite/connect/t/ini.test
parent dd8c89b2
...@@ -218,3 +218,66 @@ FR 20 ...@@ -218,3 +218,66 @@ FR 20
RU 30 RU 30
US 40 US 40
DROP TABLE t1; DROP TABLE t1;
#
# Bug: TABLE_TYPE=ini does not clear memory between CREATE TABLEs
#
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=INI;
Warnings:
Warning 1105 No file name. Table will use t1.INI
INSERT INTO t1 VALUES ('sec1','val1'),('sec2','val2');
SELECT sec AS s, val AS v FROM t1;
s v
sec1 val1
sec2 val2
DROP TABLE t1;
CREATE TABLE t1 (sec2 CHAR(10) NOT NULL FLAG=1, val2 CHAR(10) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=INI;
Warnings:
Warning 1105 No file name. Table will use t1.INI
INSERT INTO t1 VALUES ('sec1','val11'),('sec2','val22');
SELECT sec2 AS s, val2 AS v FROM t1;
s v
sec1 val11
sec2 val22
SELECT REPLACE(REPLACE(LOAD_FILE('DATADIR/test/t1.INI'),'\r\n','\n'),'\n\n','\n');;
REPLACE(REPLACE(LOAD_FILE('DATADIR/test/t1.INI'),'\r\n','\n'),'\n\n','\n')
[sec1]
val2=val11
[sec2]
val2=val22
DROP TABLE t1;
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=INI;
Warnings:
Warning 1105 No file name. Table will use t1.INI
CREATE TABLE t2 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=INI;
Warnings:
Warning 1105 No file name. Table will use t2.INI
INSERT INTO t1 VALUES('1sec1','1val1'),('1sec2','1val2');
INSERT INTO t2 VALUES('2sec1','2val1'),('2sec2','2val2');
SELECT sec AS s, val AS v FROM t1;
s v
1sec1 1val1
1sec2 1val2
SELECT REPLACE(REPLACE(LOAD_FILE('DATADIR/test/t1.INI'),'\r\n','\n'),'\n\n','\n');;
REPLACE(REPLACE(LOAD_FILE('DATADIR/test/t1.INI'),'\r\n','\n'),'\n\n','\n')
[1sec1]
val=1val1
[1sec2]
val=1val2
SELECT sec AS s, val AS v FROM t2;
s v
2sec1 2val1
2sec2 2val2
SELECT REPLACE(REPLACE(LOAD_FILE('DATADIR/test/t2.INI'),'\r\n','\n'),'\n\n','\n');;
REPLACE(REPLACE(LOAD_FILE('DATADIR/test/t2.INI'),'\r\n','\n'),'\n\n','\n')
[2sec1]
val=2val1
[2sec2]
val=2val2
DROP TABLE t1, t2;
...@@ -119,3 +119,37 @@ DROP TABLE t1; ...@@ -119,3 +119,37 @@ DROP TABLE t1;
# #
--remove_file $MYSQLD_DATADIR/test/contact.ini --remove_file $MYSQLD_DATADIR/test/contact.ini
--remove_file $MYSQLD_DATADIR/test/tmp.ini --remove_file $MYSQLD_DATADIR/test/tmp.ini
--echo #
--echo # Bug: TABLE_TYPE=ini does not clear memory between CREATE TABLEs
--echo #
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=INI;
INSERT INTO t1 VALUES ('sec1','val1'),('sec2','val2');
SELECT sec AS s, val AS v FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (sec2 CHAR(10) NOT NULL FLAG=1, val2 CHAR(10) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=INI;
INSERT INTO t1 VALUES ('sec1','val11'),('sec2','val22');
SELECT sec2 AS s, val2 AS v FROM t1;
--chmod 0777 $MYSQLD_DATADIR/test/t1.INI
--replace_result $MYSQLD_DATADIR DATADIR
--eval SELECT REPLACE(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t1.INI'),'\r\n','\n'),'\n\n','\n');
DROP TABLE t1;
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=INI;
CREATE TABLE t2 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=INI;
INSERT INTO t1 VALUES('1sec1','1val1'),('1sec2','1val2');
INSERT INTO t2 VALUES('2sec1','2val1'),('2sec2','2val2');
SELECT sec AS s, val AS v FROM t1;
--chmod 0777 $MYSQLD_DATADIR/test/t1.INI
--replace_result $MYSQLD_DATADIR DATADIR
--eval SELECT REPLACE(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t1.INI'),'\r\n','\n'),'\n\n','\n');
SELECT sec AS s, val AS v FROM t2;
--chmod 0777 $MYSQLD_DATADIR/test/t2.INI
--replace_result $MYSQLD_DATADIR DATADIR
--eval SELECT REPLACE(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t2.INI'),'\r\n','\n'),'\n\n','\n');
DROP TABLE t1, t2;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment