mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
cleanup: select ... into
tests
* automatically disable ps2 and cursor protocol when the select statement returns no result set * remove manual {disable|enable}_{ps2|cursor}_protocol from around `select ... into` in tests * other misc collateral test cleanups
This commit is contained in:
@@ -8725,7 +8725,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
|
||||
DYNAMIC_STRING ds_res_1st_execution;
|
||||
my_bool ds_res_1st_execution_init = FALSE;
|
||||
my_bool compare_2nd_execution = TRUE;
|
||||
int query_match_ps2_re;
|
||||
int query_match_ps2_re, query_match_cursor_re;
|
||||
MYSQL_RES *res;
|
||||
DBUG_ENTER("run_query_stmt");
|
||||
DBUG_PRINT("query", ("'%-.60s'", query));
|
||||
@@ -8784,6 +8784,9 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
|
||||
parameter markers.
|
||||
*/
|
||||
|
||||
query_match_cursor_re= cursor_protocol_enabled && cn->stmt->field_count &&
|
||||
match_re(&cursor_re, query);
|
||||
|
||||
if (cursor_protocol_enabled)
|
||||
{
|
||||
ps2_protocol_enabled = 0;
|
||||
@@ -8792,7 +8795,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
|
||||
Use cursor for queries matching the filter,
|
||||
else reset cursor type
|
||||
*/
|
||||
if (match_re(&cursor_re, query))
|
||||
if (query_match_cursor_re)
|
||||
{
|
||||
/*
|
||||
Use cursor when retrieving result
|
||||
@@ -8804,12 +8807,13 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
|
||||
}
|
||||
}
|
||||
|
||||
query_match_ps2_re = match_re(&ps2_re, query);
|
||||
query_match_ps2_re = ps2_protocol_enabled && cn->stmt->field_count &&
|
||||
match_re(&ps2_re, query);
|
||||
|
||||
/*
|
||||
Execute the query first time if second execution enable
|
||||
*/
|
||||
if (ps2_protocol_enabled && query_match_ps2_re)
|
||||
if (query_match_ps2_re)
|
||||
{
|
||||
if (do_stmt_execute(cn))
|
||||
{
|
||||
@@ -8865,8 +8869,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
|
||||
and keep them in a separate string for later. Cursor_protocol is used
|
||||
only for queries matching the filter "cursor_re".
|
||||
*/
|
||||
if (cursor_protocol_enabled && match_re(&cursor_re, query) &&
|
||||
!disable_warnings)
|
||||
if (query_match_cursor_re && !disable_warnings)
|
||||
append_warnings(&ds_execute_warnings, mysql);
|
||||
|
||||
if (read_stmt_results(stmt, ds, command))
|
||||
@@ -8878,7 +8881,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
|
||||
The results of the first and second execution are compared
|
||||
only if result logging is enabled
|
||||
*/
|
||||
if (compare_2nd_execution && ps2_protocol_enabled && query_match_ps2_re)
|
||||
if (compare_2nd_execution && query_match_ps2_re)
|
||||
{
|
||||
if (ds->length != ds_res_1st_execution.length ||
|
||||
!(memcmp(ds_res_1st_execution.str, ds->str, ds->length) == 0))
|
||||
|
@@ -258,10 +258,8 @@ select * from t2;
|
||||
insert into t2 (a) values (1025);
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR ..
|
||||
--disable_cursor_protocol
|
||||
--error ER_DUP_ENTRY
|
||||
eval select f2(25) into outfile "$MYSQLTEST_VARDIR/tmp/dml.out" from t1;
|
||||
--enable_cursor_protocol
|
||||
select * from t2;
|
||||
rollback;
|
||||
select * from t2;
|
||||
@@ -281,10 +279,8 @@ select * from t2;
|
||||
--echo =======================================================================
|
||||
|
||||
insert into t2 (a) values (1027);
|
||||
--disable_cursor_protocol
|
||||
--error ER_DUP_ENTRY
|
||||
select f2(27) into @foo;
|
||||
--enable_cursor_protocol
|
||||
select * from t2;
|
||||
rollback;
|
||||
select * from t2;
|
||||
|
@@ -170,13 +170,9 @@ while ($_dt_tables)
|
||||
|
||||
# Now that we have the comma-separated list of columns, we can write
|
||||
# the table to a file.
|
||||
--disable_ps2_protocol
|
||||
--let $_dt_outfile= `SELECT @@datadir`
|
||||
--let $_dt_outfile= $_dt_outfile/diff_table-$_dt_connection-$_dt_database-$_dt_table
|
||||
--disable_cursor_protocol
|
||||
eval SELECT * INTO OUTFILE '$_dt_outfile' FROM $_dt_database.$_dt_table ORDER BY `$_dt_column_list`;
|
||||
--enable_cursor_protocol
|
||||
--enable_ps2_protocol
|
||||
# Restore sorting buffers.
|
||||
--eval SET SESSION max_sort_length = $_dt_old_max_sort_length;
|
||||
--eval SET SESSION sort_buffer_size = $_dt_old_sort_buffer_size;
|
||||
|
@@ -824,8 +824,6 @@ eval CREATE TABLE t2 (
|
||||
i $datetime DEFAULT $current_timestamp ON UPDATE $current_timestamp NOT NULL
|
||||
);
|
||||
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT 1 INTO OUTFILE 't3.dat' FROM dual;
|
||||
|
||||
SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
@@ -833,8 +831,6 @@ INTO OUTFILE 't4.dat'
|
||||
FROM dual;
|
||||
|
||||
SELECT 1, 2 INTO OUTFILE 't5.dat' FROM dual;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--echo # Mon Aug 1 15:11:19 2011 UTC
|
||||
SET TIMESTAMP = 1312211479.918273;
|
||||
@@ -933,13 +929,9 @@ remove_file $MYSQLD_DATADIR/test/t5.dat;
|
||||
--echo # Mon Aug 1 15:11:19 2011 UTC
|
||||
SET TIMESTAMP = 1312211479.089786;
|
||||
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT 1 INTO OUTFILE "file1.dat" FROM dual;
|
||||
SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
INTO OUTFILE "file2.dat" FROM dual;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--echo # Too short row
|
||||
|
||||
|
@@ -1,5 +0,0 @@
|
||||
-- require include/have_outfile.require
|
||||
disable_query_log;
|
||||
select load_file(concat(@tmpdir,'/outfile.test'));
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/outfile.test
|
||||
enable_query_log;
|
@@ -1,3 +0,0 @@
|
||||
load_file(concat(@tmpdir,'/outfile.test'))
|
||||
Outfile OK
|
||||
|
@@ -1,5 +0,0 @@
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select "Outfile OK" into outfile "$MYSQLTEST_VARDIR/tmp/outfile.test";
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
@@ -34,12 +34,8 @@ SET sql_mode=DEFAULT;
|
||||
--eval CREATE TABLE t1 (a $type DEFAULT $defval, b $type DEFAULT $defval)
|
||||
--eval INSERT INTO t1 VALUES (DEFAULT,DEFAULT);
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_ps2_protocol
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1
|
||||
--enable_cursor_protocol
|
||||
DELETE FROM t1;
|
||||
--enable_ps2_protocol
|
||||
SET sql_mode=TRADITIONAL;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
|
||||
|
@@ -11,11 +11,7 @@ set default_storage_engine=innodb;
|
||||
#
|
||||
create table t1 (pk int auto_increment primary key, f varchar(20));
|
||||
insert t1 (f) values ('a'), ('b'), ('c'), ('d');
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select null, f into outfile 'load.data' from t1 limit 1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
load data infile 'load.data' into table t1;
|
||||
insert t1 (f) values ('<===');
|
||||
select * from t1;
|
||||
|
@@ -17,6 +17,8 @@ ERROR 42S02: Unknown table 'test.t1'
|
||||
#
|
||||
# Bootstrap with a large thd->net.max_packet
|
||||
#
|
||||
create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b;
|
||||
select * into outfile 'MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
|
||||
# Kill the server
|
||||
# restart
|
||||
drop table t1;
|
||||
|
@@ -43,14 +43,9 @@ remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql;
|
||||
--echo #
|
||||
--echo # Bootstrap with a large thd->net.max_packet
|
||||
--echo #
|
||||
--disable_query_log
|
||||
create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--enable_query_log
|
||||
--source include/kill_mysqld.inc
|
||||
--error 1
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
|
||||
|
@@ -78,11 +78,7 @@ select hex(convert(_big5 0xC84041 using ucs2));
|
||||
set names big5;
|
||||
create table t1 (a blob);
|
||||
insert into t1 values (0xEE00);
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 'test/t1.txt' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
delete from t1;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
|
@@ -1,4 +1,3 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
SET @test_character_set= 'ucs2';
|
||||
SET @test_collation= 'ucs2_general_ci';
|
||||
SET @safe_character_set_server= @@character_set_server;
|
||||
|
@@ -1,9 +1,5 @@
|
||||
-- source include/have_ucs2.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
SET @test_character_set= 'ucs2';
|
||||
SET @test_collation= 'ucs2_general_ci';
|
||||
-- source include/ctype_common.inc
|
||||
@@ -75,13 +71,9 @@ DROP TABLE t1;
|
||||
|
||||
--echo # Problem # 1 (original report): wrong parsing of ucs2 data
|
||||
SET character_set_connection=ucs2;
|
||||
--disable_cursor_protocol
|
||||
--enable_prepare_warnings
|
||||
--disable_ps2_protocol
|
||||
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
|
||||
--disable_prepare_warnings
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
CREATE TABLE t1(a INT);
|
||||
LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
|
||||
(@b) SET a=REVERSE(@b);
|
||||
@@ -92,14 +84,10 @@ DROP TABLE t1;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
remove_file $MYSQLD_DATADIR/test/tmpp.txt;
|
||||
|
||||
--disable_ps2_protocol
|
||||
--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
|
||||
--disable_cursor_protocol
|
||||
--enable_prepare_warnings
|
||||
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
|
||||
--disable_prepare_warnings
|
||||
--enable_cursor_protocol
|
||||
--enable_ps2_protocol
|
||||
CREATE TABLE t1(a INT);
|
||||
LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
|
||||
(@b) SET a=REVERSE(@b);
|
||||
|
@@ -652,7 +652,6 @@ SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
|
||||
SELECT @v17, @v18;
|
||||
@v17 @v18
|
||||
4 Bob
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
|
||||
default NULL);
|
||||
SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
|
||||
|
@@ -460,7 +460,6 @@ INSERT INTO t1 VALUES (2,2,'APPLE');
|
||||
INSERT INTO t1 VALUES (3,2,'APPLE');
|
||||
INSERT INTO t1 VALUES (4,3,'PEAR');
|
||||
|
||||
--disable_cursor_protocol
|
||||
SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name =
|
||||
'APPLE';
|
||||
SELECT @v1, @v2;
|
||||
@@ -488,28 +487,19 @@ SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
|
||||
'APPLE';
|
||||
SELECT @v17, @v18;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
|
||||
default NULL);
|
||||
|
||||
--disable_ps2_protocol
|
||||
SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
|
||||
'../../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
|
||||
--enable_ps2_protocol
|
||||
LOAD DATA INFILE '../../tmp/data1.tmp' INTO TABLE t2;
|
||||
--error 0,1
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/data1.tmp
|
||||
|
||||
--disable_ps2_protocol
|
||||
SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
|
||||
'../../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
|
||||
--enable_ps2_protocol
|
||||
LOAD DATA INFILE '../../tmp/data2.tmp' INTO TABLE t2;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/data2.tmp
|
||||
--enable_cursor_protocol
|
||||
|
||||
SELECT @v19, @v20;
|
||||
SELECT * FROM t2;
|
||||
|
@@ -156,14 +156,10 @@ show status like "feature_insert_returning";
|
||||
--echo #
|
||||
create table t1(id1 int);
|
||||
insert into t1 values (1),(2);
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile '../../tmp/features_outfile.1' from t1;
|
||||
select * from t1 into outfile '../../tmp/features_outfile.2';
|
||||
--enable_ps2_protocol
|
||||
select id1 INTO @x from t1 where id1=1;
|
||||
select * from t1 where id1=1 into @y;
|
||||
--enable_cursor_protocol
|
||||
select * from t1 where id1=@x;
|
||||
select @x=@y;
|
||||
drop table t1;
|
||||
|
@@ -1537,11 +1537,7 @@ SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3));
|
||||
--echo #
|
||||
CREATE TABLE t1 ( a TEXT );
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt';
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' );
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;
|
||||
|
@@ -4,9 +4,7 @@
|
||||
# Save the initial number of concurrent sessions
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--disable_cursor_protocol
|
||||
select priv into @root_priv from mysql.global_priv where user='root' and host='localhost';
|
||||
--enable_cursor_protocol
|
||||
|
||||
set GLOBAL sql_mode="";
|
||||
set LOCAL sql_mode="";
|
||||
@@ -660,10 +658,8 @@ DROP DATABASE db1;
|
||||
|
||||
# work out who we are.
|
||||
USE mysql;
|
||||
--disable_cursor_protocol
|
||||
SELECT LEFT(CURRENT_USER(),INSTR(CURRENT_USER(),'@')-1) INTO @u;
|
||||
SELECT MID(CURRENT_USER(),INSTR(CURRENT_USER(),'@')+1) INTO @h;
|
||||
--enable_cursor_protocol
|
||||
|
||||
# show current privs.
|
||||
SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h;
|
||||
@@ -845,11 +841,7 @@ SHOW CREATE TABLE t1;
|
||||
--echo #
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug27480.txt' FROM t1
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug27480.txt' INTO TABLE t1
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/bug27480.txt
|
||||
|
@@ -596,11 +596,7 @@ CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = cast('' as
|
||||
REPLACE INTO v1 SET f2 = 1;
|
||||
SELECT * from t1;
|
||||
drop view v1;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT 0,0 INTO OUTFILE 't1.txt';
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION;
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
LOAD DATA INFILE 't1.txt' INTO TABLE v1;
|
||||
|
@@ -251,12 +251,8 @@ DROP TABLE t1;
|
||||
create or replace table t1 (a int, b int invisible);
|
||||
insert into t1 values (1),(2);
|
||||
|
||||
--disable_cursor_protocol
|
||||
--enable_prepare_warnings
|
||||
--disable_ps2_protocol
|
||||
select * from t1 into outfile 'f';
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
load data infile 'f' into table t1;
|
||||
select a,b from t1;
|
||||
load data infile 'f' into table t1 (a,@v) SET b=@v;
|
||||
@@ -266,11 +262,7 @@ select a,b from t1;
|
||||
truncate table t1;
|
||||
|
||||
insert into t1(a,b) values (1,1),(2,2);
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select a,b from t1 into outfile 'a';
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
load data infile 'a' into table t1(a,b);
|
||||
select a,b from t1;
|
||||
load data infile 'a' into table t1 (a,@v) SET b=@v;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
ALTER DATABASE test CHARACTER SET latin1 COLLATE latin1_swedish_ci;
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (a date, b date, c date not null, d date);
|
||||
load data infile '../../std_data/loaddata1.dat' ignore into table t1 fields terminated by ',';
|
||||
Warnings:
|
||||
@@ -77,9 +76,18 @@ drop table t1;
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
create table t1(id integer not null auto_increment primary key);
|
||||
insert into t1 values(0);
|
||||
SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' from t1;
|
||||
delete from t1;
|
||||
load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1;
|
||||
select * from t1;
|
||||
id
|
||||
0
|
||||
SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1'
|
||||
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
|
||||
FROM t1;
|
||||
delete from t1;
|
||||
load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1
|
||||
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'id' at row 1
|
||||
select * from t1;
|
||||
@@ -239,6 +247,9 @@ drop table t1, t2;
|
||||
create table t1(f1 int);
|
||||
insert into t1 values(1),(null);
|
||||
create table t2(f2 int auto_increment primary key);
|
||||
select * into outfile '$MYSQLTEST_VARDIR/tmp/t1' from t1;
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2;
|
||||
select * from t2;
|
||||
f2
|
||||
1
|
||||
@@ -248,6 +259,8 @@ drop table t1,t2;
|
||||
create table t1(f1 int, f2 timestamp not null default current_timestamp);
|
||||
create table t2(f1 int);
|
||||
insert into t2 values(1),(2);
|
||||
select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2;
|
||||
load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1;
|
||||
Warnings:
|
||||
Warning 1261 Row 1 doesn't contain data for all columns
|
||||
Warning 1261 Row 2 doesn't contain data for all columns
|
||||
@@ -256,6 +269,11 @@ f1
|
||||
1
|
||||
2
|
||||
delete from t1;
|
||||
SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2'
|
||||
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
|
||||
FROM t2;
|
||||
load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1
|
||||
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f1' at row 1
|
||||
Warning 1261 Row 1 doesn't contain data for all columns
|
||||
|
@@ -2,15 +2,9 @@
|
||||
# Some simple test of load data
|
||||
#
|
||||
|
||||
-- source include/have_ucs2.inc
|
||||
|
||||
--source include/have_ucs2.inc
|
||||
--source include/test_db_charset_latin1.inc
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (a date, b date, c date not null, d date);
|
||||
load data infile '../../std_data/loaddata1.dat' ignore into table t1 fields terminated by ',';
|
||||
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
|
||||
@@ -39,35 +33,25 @@ drop table t1;
|
||||
#
|
||||
# Bug #12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting
|
||||
#
|
||||
--disable_ps2_protocol
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
create table t1(id integer not null auto_increment primary key);
|
||||
insert into t1 values(0);
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' from t1;
|
||||
--enable_cursor_protocol
|
||||
evalp SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' from t1;
|
||||
delete from t1;
|
||||
eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1;
|
||||
enable_query_log;
|
||||
evalp load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1;
|
||||
select * from t1;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/t1;
|
||||
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1'
|
||||
evalp SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1'
|
||||
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
|
||||
FROM t1;
|
||||
--enable_cursor_protocol
|
||||
delete from t1;
|
||||
eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1
|
||||
evalp load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1
|
||||
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
|
||||
enable_query_log;
|
||||
select * from t1;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/t1;
|
||||
SET @@SQL_MODE=@OLD_SQL_MODE;
|
||||
drop table t1;
|
||||
--enable_ps2_protocol
|
||||
|
||||
#
|
||||
# Bug #11203: LOAD DATA does not accept same characters for ESCAPED and
|
||||
@@ -101,11 +85,7 @@ INSERT INTO t1 (c1) VALUES
|
||||
SELECT * FROM t1;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
cat_file $MYSQLTEST_VARDIR/tmp/t1;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
@@ -192,15 +172,9 @@ drop table t1, t2;
|
||||
create table t1(f1 int);
|
||||
insert into t1 values(1),(null);
|
||||
create table t2(f2 int auto_increment primary key);
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t1' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
evalp select * into outfile '$MYSQLTEST_VARDIR/tmp/t1' from t1;
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2;
|
||||
enable_query_log;
|
||||
evalp load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2;
|
||||
select * from t2;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/t1;
|
||||
SET @@SQL_MODE=@OLD_SQL_MODE;
|
||||
@@ -213,28 +187,16 @@ drop table t1,t2;
|
||||
create table t1(f1 int, f2 timestamp not null default current_timestamp);
|
||||
create table t2(f1 int);
|
||||
insert into t2 values(1),(2);
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1;
|
||||
enable_query_log;
|
||||
evalp select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2;
|
||||
evalp load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1;
|
||||
select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/t2;
|
||||
delete from t1;
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2'
|
||||
evalp SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2'
|
||||
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
|
||||
FROM t2;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1
|
||||
evalp load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1
|
||||
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
|
||||
enable_query_log;
|
||||
select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/t2;
|
||||
drop table t1,t2;
|
||||
@@ -250,11 +212,7 @@ INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1
|
||||
SELECT * FROM t1;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
cat_file $MYSQLTEST_VARDIR/tmp/t1;
|
||||
echo EOF;
|
||||
|
||||
@@ -391,12 +349,8 @@ SET @OLD_SQL_MODE=@@SESSION.SQL_MODE;
|
||||
|
||||
SET sql_mode = '';
|
||||
|
||||
--disable_ps2_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT '1 \\\\aa\n' INTO DUMPFILE '$file'
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
CREATE TABLE t1 (id INT, val1 CHAR(3)) ENGINE=MyISAM;
|
||||
|
||||
@@ -408,21 +362,13 @@ SELECT * FROM t1;
|
||||
|
||||
# show we can write this with OUTFILE, forcing the parameters for now
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file2' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--diff_files $file $file2
|
||||
--remove_file $file2
|
||||
|
||||
# now show the OUTFILE defaults are correct with NO_BACKSLASH_ESCAPES
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file2' FIELDS TERMINATED BY ' ' FROM t1
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--diff_files $file $file2
|
||||
--remove_file $file2
|
||||
|
||||
@@ -455,11 +401,7 @@ INSERT INTO t1 (id, val1) VALUES (3, '\tx');
|
||||
--echo 1.1 NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS TERMINATED BY ' '
|
||||
@@ -476,11 +418,7 @@ eval SELECT LOAD_FILE("$file") as exp;
|
||||
--echo 1.2 NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY '\' TERMINATED BY ' ' FROM t1 ORDER BY id
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS ESCAPED BY '\' TERMINATED BY ' '
|
||||
@@ -502,11 +440,7 @@ SET sql_mode = '';
|
||||
--echo 2.1 !NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS TERMINATED BY ' '
|
||||
@@ -529,11 +463,7 @@ SET sql_mode = '';
|
||||
--echo 2.2 !NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1 ORDER BY id
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS ESCAPED BY '' TERMINATED BY ' '
|
||||
@@ -575,11 +505,7 @@ INSERT INTO t1 VALUES (1);
|
||||
SET NAMES latin1;
|
||||
SET character_set_filesystem=filename;
|
||||
select @@character_set_filesystem;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT * INTO OUTFILE 't-1' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
DELETE FROM t1;
|
||||
LOAD DATA INFILE 't-1' INTO TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
@@ -601,11 +527,7 @@ select @@character_set_filesystem;
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(col0 LONGBLOB);
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT 'test' INTO OUTFILE 't1.txt';
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
LOAD DATA INFILE 't1.txt' IGNORE INTO TABLE t1 SET col0=col0;
|
||||
SELECT * FROM t1;
|
||||
|
||||
@@ -674,11 +596,7 @@ disconnect con1;
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(f1 INT);
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
eval SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
|
||||
--disable_warnings
|
||||
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
|
||||
--enable_warnings
|
||||
@@ -692,13 +610,9 @@ remove_file $MYSQLD_DATADIR/test/t1.dat;
|
||||
--echo # WHEN ERROR OCCURS
|
||||
--echo #
|
||||
|
||||
--disable_ps2_protocol
|
||||
--let $file=$MYSQLTEST_VARDIR/tmp/bug11735141.txt
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT '1\n' INTO DUMPFILE '$file'
|
||||
--enable_cursor_protocol
|
||||
--enable_ps2_protocol
|
||||
|
||||
create table t1(a point);
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
@@ -785,11 +699,7 @@ CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE(b));
|
||||
INSERT INTO t1 VALUES (1,1);
|
||||
CREATE TABLE t2 (c INT);
|
||||
CREATE VIEW v AS SELECT t1.* FROM t1 JOIN t2;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT a, b INTO OUTFILE '15645.data' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error ER_WRONG_USAGE
|
||||
LOAD DATA INFILE '15645.data' IGNORE INTO TABLE v (a,b);
|
||||
--error ER_WRONG_USAGE
|
||||
@@ -848,12 +758,8 @@ CREATE OR REPLACE TABLE t1 (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)'));
|
||||
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
CREATE OR REPLACE TABLE t2 LIKE t1;
|
||||
|
||||
@@ -870,12 +776,8 @@ CREATE OR REPLACE TABLE t1 (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)'),"їєі");
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
CREATE OR REPLACE TABLE t2 LIKE t1;
|
||||
|
||||
|
@@ -16,11 +16,7 @@ insert into t1 () values
|
||||
(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
|
||||
(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
|
||||
(),(),(),();
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 'load.data' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
create temporary table tmp (a varchar(1024), b int, c int, d int, e linestring, unique (e));
|
||||
load data infile 'load.data' into table tmp;
|
||||
delete from tmp;
|
||||
@@ -232,11 +228,7 @@ drop table t1;
|
||||
--echo #
|
||||
CREATE TABLE t1 (data VARCHAR(4), unique(data) using hash) with system versioning;
|
||||
INSERT INTO t1 VALUES ('A');
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT * INTO OUTFILE 'load.data' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error ER_DUP_ENTRY
|
||||
LOAD DATA INFILE 'load.data' INTO TABLE t1;
|
||||
select * from t1;
|
||||
@@ -250,11 +242,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (data VARCHAR(7961)) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t1 VALUES ('f'), ('o'), ('o');
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT * INTO OUTFILE 'load.data' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
ALTER IGNORE TABLE t1 ADD UNIQUE INDEX (data);
|
||||
SELECT * FROM t1;
|
||||
@@ -519,11 +507,7 @@ drop table t2;
|
||||
--echo #
|
||||
create table t1 (pk int primary key, f blob, unique(f)) engine=innodb;
|
||||
insert t1 values (1, null);
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 't1.data' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
load data infile 't1.data' replace into table t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
@@ -56,12 +56,8 @@ $
|
||||
--echo # then use it for loading data into the table `t1`
|
||||
CREATE TABLE t2 (a INT);
|
||||
INSERT INTO t2 VALUES (1), (2), (1), (3), (5);
|
||||
--disable_ps2_protocol
|
||||
--disable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2' FROM t2
|
||||
--enable_cursor_protocol
|
||||
--enable_ps2_protocol
|
||||
--echo # Execution of the following LOAD DATA INFILE statement produces warnings
|
||||
--echo # for the rows (1) filtered out by the statement SIGNAL SQLSTATE '02TRG'
|
||||
--echo # invoked from the trigger
|
||||
|
@@ -145,20 +145,12 @@ set sort_buffer_size= 2097152;
|
||||
--source include/analyze-format.inc
|
||||
eval ANALYZE FORMAT=JSON SELECT id, names, address FROM t3 ORDER BY names, address;
|
||||
flush status;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
evalp SELECT id, names, address INTO OUTFILE '$file1' FROM t3 ORDER BY names, address;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--echo # Sort_merge_passes should be 0
|
||||
show status like '%sort%';
|
||||
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
evalp SELECT id, names, address INTO OUTFILE '$file2' FROM t3 FORCE INDEX(idx) ORDER BY names, address;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
diff_files $file1 $file2;
|
||||
|
||||
@@ -175,11 +167,7 @@ set sort_buffer_size= 1097152;
|
||||
--source include/analyze-format.inc
|
||||
eval ANALYZE FORMAT=JSON SELECT id, names, address FROM t3 ORDER BY names, address;
|
||||
flush status;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
evalp SELECT id, names, address INTO OUTFILE '$file1' FROM t3 ORDER BY names, address;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--echo # Sort_merge_passes should be 0
|
||||
show status like '%sort%';
|
||||
|
Binary file not shown.
@@ -1,75 +1,39 @@
|
||||
disable_query_log;
|
||||
-- source include/test_outfile.inc
|
||||
# Server are started in "var/master-data", so "../../tmp" will be "var/tmp"
|
||||
eval set @tmpdir="../../tmp";
|
||||
enable_query_log;
|
||||
-- source include/have_outfile.inc
|
||||
|
||||
--source include/not_embedded.inc
|
||||
# Save the initial number of concurrent sessions
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--disable_ps2_protocol
|
||||
|
||||
#
|
||||
# test of into outfile|dumpfile
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (`a` blob);
|
||||
insert into t1 values("hello world"),("Hello mars"),(NULL);
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
eval select * into outfile "../../tmp/outfile-test.1" from t1;
|
||||
--enable_cursor_protocol
|
||||
enable_query_log;
|
||||
select load_file(concat(@tmpdir,"/outfile-test.1"));
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
eval select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1;
|
||||
--enable_cursor_protocol
|
||||
enable_query_log;
|
||||
select load_file(concat(@tmpdir,"/outfile-test.2"));
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
eval select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null;
|
||||
--enable_cursor_protocol
|
||||
enable_query_log;
|
||||
select load_file(concat(@tmpdir,"/outfile-test.3"));
|
||||
select * into outfile "../../tmp/outfile-test.1" from t1;
|
||||
select load_file('../../tmp/outfile-test.1');
|
||||
select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1;
|
||||
select load_file('../../tmp/outfile-test.2');
|
||||
select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null;
|
||||
select load_file('../../tmp/outfile-test.3');
|
||||
|
||||
# the following should give errors
|
||||
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
--error ER_FILE_EXISTS_ERROR
|
||||
eval select * into outfile "../../tmp/outfile-test.1" from t1;
|
||||
--enable_cursor_protocol
|
||||
|
||||
--disable_cursor_protocol
|
||||
--error ER_FILE_EXISTS_ERROR
|
||||
eval select * into dumpfile "../../tmp/outfile-test.2" from t1;
|
||||
--enable_cursor_protocol
|
||||
|
||||
--disable_cursor_protocol
|
||||
--error ER_FILE_EXISTS_ERROR
|
||||
eval select * into dumpfile "../../tmp/outfile-test.3" from t1;
|
||||
--enable_cursor_protocol
|
||||
enable_query_log;
|
||||
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
|
||||
select load_file('../../tmp/outfile-test.not-exist');
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.2
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
|
||||
drop table t1;
|
||||
|
||||
# Bug#8191 SELECT INTO OUTFILE insists on FROM clause
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
eval select 1 into outfile "../../tmp/outfile-test.4";
|
||||
--enable_cursor_protocol
|
||||
enable_query_log;
|
||||
select load_file(concat(@tmpdir,"/outfile-test.4"));
|
||||
select 1 into outfile "../../tmp/outfile-test.4";
|
||||
select load_file('../../tmp/outfile-test.4');
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
|
||||
|
||||
#
|
||||
@@ -89,23 +53,16 @@ DROP TABLE t1;
|
||||
#
|
||||
# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
|
||||
#
|
||||
disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
|
||||
SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
|
||||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
FROM information_schema.schemata LIMIT 0, 5;
|
||||
--enable_cursor_protocol
|
||||
# enable_query_log;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
|
||||
|
||||
use information_schema;
|
||||
# disable_query_log;
|
||||
--disable_cursor_protocol
|
||||
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
|
||||
SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
|
||||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
FROM schemata LIMIT 0, 5;
|
||||
--enable_cursor_protocol
|
||||
enable_query_log;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
|
||||
use test;
|
||||
|
||||
@@ -115,10 +72,8 @@ use test;
|
||||
# It should not be possible to write to a file outside of vardir
|
||||
create table t1(a int);
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--disable_cursor_protocol
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
eval select * into outfile "$MYSQL_TEST_DIR/outfile-test1" from t1;
|
||||
--enable_cursor_protocol
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
@@ -130,29 +85,25 @@ create user user_1@localhost;
|
||||
grant all on mysqltest.* to user_1@localhost;
|
||||
connect (con28181_1,localhost,user_1,,mysqltest);
|
||||
|
||||
--disable_cursor_protocol
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
eval select schema_name
|
||||
select schema_name
|
||||
into outfile "../../tmp/outfile-test.4"
|
||||
fields terminated by ',' optionally enclosed by '"'
|
||||
lines terminated by '\n'
|
||||
from information_schema.schemata
|
||||
where schema_name like 'mysqltest';
|
||||
--enable_cursor_protocol
|
||||
|
||||
connection default;
|
||||
disconnect con28181_1;
|
||||
grant file on *.* to user_1@localhost;
|
||||
|
||||
connect (con28181_2,localhost,user_1,,mysqltest);
|
||||
--disable_cursor_protocol
|
||||
eval select schema_name
|
||||
select schema_name
|
||||
into outfile "../../tmp/outfile-test.4"
|
||||
fields terminated by ',' optionally enclosed by '"'
|
||||
lines terminated by '\n'
|
||||
from information_schema.schemata
|
||||
where schema_name like 'mysqltest';
|
||||
--enable_cursor_protocol
|
||||
|
||||
connection default;
|
||||
disconnect con28181_2;
|
||||
@@ -164,4 +115,3 @@ drop database mysqltest;
|
||||
|
||||
# Wait till we reached the initial number of concurrent sessions
|
||||
--source include/wait_until_count_sessions.inc
|
||||
--enable_ps2_protocol
|
||||
|
@@ -1,4 +1,3 @@
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
ALTER DATABASE test CHARACTER SET latin1 COLLATE latin1_swedish_ci;
|
||||
#
|
||||
# Bug#31663 FIELDS TERMINATED BY special character
|
||||
|
@@ -1,10 +1,5 @@
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
--source include/test_db_charset_latin1.inc
|
||||
|
||||
--disable_ps2_protocol
|
||||
--echo #
|
||||
--echo # Bug#31663 FIELDS TERMINATED BY special character
|
||||
--echo #
|
||||
@@ -17,9 +12,7 @@ INSERT INTO t1 VALUES (101, 202, '-r-', '=raker=');
|
||||
--echo # $clauses, warning:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
||||
--enable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp
|
||||
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
||||
@@ -34,9 +27,7 @@ DROP TABLE t2;
|
||||
--echo # Only numeric fields, $clauses, no warnings:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
||||
--enable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp
|
||||
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
||||
@@ -51,9 +42,7 @@ DROP TABLE t2;
|
||||
--echo # $clauses, warning:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
||||
--enable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp
|
||||
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
||||
@@ -68,9 +57,7 @@ DROP TABLE t2;
|
||||
--echo # $clauses, warning:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
||||
--enable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp
|
||||
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
||||
@@ -85,9 +72,7 @@ DROP TABLE t2;
|
||||
--echo # Only string fields, $clauses, no warnings:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
||||
--enable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp
|
||||
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
||||
@@ -110,9 +95,7 @@ SELECT HEX(c1) FROM t1;
|
||||
--let $file=$MYSQLTEST_VARDIR/tmp/bug32533.txt
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS ENCLOSED BY 0xC3 FROM t1
|
||||
--enable_cursor_protocol
|
||||
TRUNCATE t1;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
@@ -147,17 +130,13 @@ INSERT INTO t1 VALUES (1, 'ABC-АБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
|
||||
--echo # Error on multi-character ENCLOSED/ESCAPED BY
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--error 1083
|
||||
--error ER_WRONG_FIELD_TERMINATORS
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS ENCLOSED BY '12345'
|
||||
--enable_cursor_protocol
|
||||
--remove_file $file
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--error 1083
|
||||
--error ER_WRONG_FIELD_TERMINATORS
|
||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS ESCAPED BY '12345'
|
||||
--enable_cursor_protocol
|
||||
--remove_file $file
|
||||
|
||||
|
||||
@@ -165,27 +144,21 @@ INSERT INTO t1 VALUES (1, 'ABC-АБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
|
||||
--echo # LOAD DATA rises error or has unpredictable result -- to be fixed later
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS ENCLOSED BY 'ъ' FROM t1
|
||||
--enable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--error 1083 # backward compatibility
|
||||
--error ER_WRONG_FIELD_TERMINATORS # backward compatibility
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS ENCLOSED BY 'ъ'
|
||||
--remove_file $file
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY 'ъ' FROM t1
|
||||
--enable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--error 1083 # backward compatibility
|
||||
--error ER_WRONG_FIELD_TERMINATORS # backward compatibility
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS ESCAPED BY 'ъ'
|
||||
--remove_file $file
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY 'ъ' FROM t1
|
||||
--enable_cursor_protocol
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@@ -198,9 +171,7 @@ SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' LINES STARTING BY 'ъ' FROM t1
|
||||
--enable_cursor_protocol
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@@ -211,9 +182,7 @@ TRUNCATE t2;
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' LINES TERMINATED BY 'ъ' FROM t1
|
||||
--enable_cursor_protocol
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@@ -228,9 +197,7 @@ SELECT * FROM t2;
|
||||
--echo # Default (binary) charset:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' FROM t1
|
||||
--enable_cursor_protocol
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@@ -244,9 +211,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
--echo # latin1 charset (INTO OUTFILE warning is expected):
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' CHARACTER SET latin1 FROM t1
|
||||
--enable_cursor_protocol
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@@ -260,9 +225,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
--echo # KOI8-R charset (INTO OUTFILE warning is expected):
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' CHARACTER SET koi8r FROM t1
|
||||
--enable_cursor_protocol
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@@ -276,9 +239,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
--echo # UTF-8 charset:
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE '$file' CHARACTER SET utf8 FROM t1
|
||||
--enable_cursor_protocol
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@@ -310,9 +271,7 @@ let $length= 800;
|
||||
--eval INSERT INTO t1 VALUES (REPEAT('.', $length))
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--eval SELECT * INTO OUTFILE $file CHARACTER SET latin1 FROM t1
|
||||
--enable_cursor_protocol
|
||||
|
||||
--echo # should be greater than $length
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
@@ -329,7 +288,6 @@ SELECT LENGTH(a) FROM t2;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--disable_prepare_warnings
|
||||
--enable_ps2_protocol
|
||||
|
||||
###########################################################################
|
||||
--echo # End of 5.1 tests.
|
||||
|
@@ -19,9 +19,7 @@ SET default_storage_engine= InnoDB;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
COMMIT;
|
||||
--disable_ps2_protocol
|
||||
SELECT * INTO OUTFILE 'load.data' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
|
||||
LOAD DATA INFILE 'load.data' INTO TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
|
@@ -13,10 +13,6 @@ flush query cache;
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush global status;
|
||||
drop table if exists t1,t2,t3,t4,t11,t21,t1_1,t1_2,t9,t9_1,t9_2;
|
||||
drop database if exists mysqltest;
|
||||
drop table if exists ```a`;
|
||||
drop view if exists v1;
|
||||
create table t1 (a int not null);
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
@@ -1085,7 +1081,6 @@ Qcache_hits 4
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
drop procedure if exists p1;
|
||||
CREATE PROCEDURE `p1`()
|
||||
begin
|
||||
Declare c1 cursor for select a from t1;
|
||||
@@ -1617,8 +1612,6 @@ Qcache_free_blocks 1
|
||||
set global query_cache_type=on;
|
||||
set session query_cache_type=on;
|
||||
Restore default values.
|
||||
drop database if exists db1;
|
||||
drop database if exists db2;
|
||||
set GLOBAL query_cache_size=15*1024*1024;
|
||||
create database db1;
|
||||
use db1;
|
||||
@@ -1638,8 +1631,6 @@ Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop database db2;
|
||||
set global query_cache_size=@save_query_cache_size;
|
||||
drop database if exists db1;
|
||||
drop database if exists db3;
|
||||
set GLOBAL query_cache_size=15*1024*1024;
|
||||
create database db1;
|
||||
create database db3;
|
||||
@@ -1702,7 +1693,6 @@ Qcache_hits 1
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL concurrent_insert= @save_concurrent_insert;
|
||||
SET GLOBAL query_cache_size= default;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
FLUSH GLOBAL STATUS;
|
||||
SET GLOBAL query_cache_size=1048576;
|
||||
CREATE TABLE t1 (a INT);
|
||||
@@ -1759,8 +1749,6 @@ SET @row_count = 4;
|
||||
SET @sleep_time_per_result_row = 1;
|
||||
SET @max_acceptable_delay = 2;
|
||||
SET @@global.query_cache_size = 1024 * 64;
|
||||
DROP TEMPORARY TABLE IF EXISTS t_history;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TEMPORARY TABLE t_history (attempt SMALLINT,
|
||||
start_ts DATETIME, end_ts DATETIME,
|
||||
start_cached INTEGER, end_cached INTEGER);
|
||||
@@ -1914,7 +1902,6 @@ End of 5.1 tests
|
||||
#
|
||||
# Bug#51336 Assert in reload_acl_and_cache during RESET QUERY CACHE
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(id INT);
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1;
|
||||
|
@@ -26,14 +26,6 @@ flush query cache; # This crashed in some versions
|
||||
flush query cache; # This crashed in some versions
|
||||
reset query cache;
|
||||
flush global status;
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4,t11,t21,t1_1,t1_2,t9,t9_1,t9_2;
|
||||
drop database if exists mysqltest;
|
||||
|
||||
# Fix possible left overs from other tests
|
||||
drop table if exists ```a`;
|
||||
drop view if exists v1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# First simple test
|
||||
@@ -805,9 +797,6 @@ drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists p1;
|
||||
--enable_warnings
|
||||
delimiter //;
|
||||
CREATE PROCEDURE `p1`()
|
||||
begin
|
||||
@@ -1228,10 +1217,6 @@ set global query_cache_type=on;
|
||||
set session query_cache_type=on;
|
||||
|
||||
--echo Restore default values.
|
||||
--disable_warnings
|
||||
drop database if exists db1;
|
||||
drop database if exists db2;
|
||||
--enable_warnings
|
||||
set GLOBAL query_cache_size=15*1024*1024;
|
||||
create database db1;
|
||||
use db1;
|
||||
@@ -1247,10 +1232,6 @@ set session query_cache_type=on;
|
||||
drop database db2;
|
||||
set global query_cache_size=@save_query_cache_size;
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists db1;
|
||||
drop database if exists db3;
|
||||
--enable_warnings
|
||||
set GLOBAL query_cache_size=15*1024*1024;
|
||||
create database db1;
|
||||
create database db3;
|
||||
@@ -1303,10 +1284,6 @@ SET GLOBAL query_cache_size= default;
|
||||
# Bug#36326: nested transaction and select
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
FLUSH GLOBAL STATUS;
|
||||
SET GLOBAL query_cache_size=1048576;
|
||||
CREATE TABLE t1 (a INT);
|
||||
@@ -1428,10 +1405,6 @@ if (!` SELECT (@sleep_time_per_result_row * @row_count - @max_acceptable_delay >
|
||||
exit;
|
||||
}
|
||||
SET @@global.query_cache_size = 1024 * 64;
|
||||
--disable_warnings
|
||||
DROP TEMPORARY TABLE IF EXISTS t_history;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TEMPORARY TABLE t_history (attempt SMALLINT,
|
||||
start_ts DATETIME, end_ts DATETIME,
|
||||
start_cached INTEGER, end_cached INTEGER);
|
||||
@@ -1607,10 +1580,6 @@ DROP TABLE t1;
|
||||
--echo # Bug#51336 Assert in reload_acl_and_cache during RESET QUERY CACHE
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(id INT);
|
||||
|
||||
START TRANSACTION;
|
||||
|
@@ -12,12 +12,9 @@ INSERT INTO t1 values ('a');
|
||||
LET $MYSQL_TMP_DIR_UCASE= `SELECT upper('$MYSQL_TMP_DIR')`;
|
||||
LET $MYSQL_TMP_DIR_LCASE= `SELECT lower('$MYSQL_TMP_DIR')`;
|
||||
|
||||
--disable_ps2_protocol
|
||||
--disable_cursor_protocol
|
||||
#create the file
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR/B11764517.tmp' FROM t1;
|
||||
--enable_cursor_protocol
|
||||
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
show global variables like 'secure_file_priv';
|
||||
@@ -53,7 +50,6 @@ eval LOAD DATA INFILE '$MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1;
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
eval LOAD DATA INFILE "$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp" into table t1;
|
||||
|
||||
--disable_cursor_protocol
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517-2.tmp' FROM t1;
|
||||
@@ -69,7 +65,6 @@ eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR_UCASE/B11764517-4.tmp' FROM t1;
|
||||
|
||||
--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
|
||||
eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR_LCASE/B11764517-5.tmp' FROM t1;
|
||||
--enable_cursor_protocol
|
||||
|
||||
--error 0,1
|
||||
--remove_file $MYSQL_TMP_DIR/B11764517.tmp;
|
||||
@@ -82,4 +77,3 @@ eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR_LCASE/B11764517-5.tmp' FROM t1;
|
||||
--error 0,1
|
||||
--remove_file $MYSQL_TMP_DIR/B11764517-5.tmp;
|
||||
DROP TABLE t1;
|
||||
--enable_ps2_protocol
|
||||
|
@@ -4,15 +4,11 @@
|
||||
|
||||
--source include/default_charset.inc
|
||||
|
||||
--disable_ps2_protocol
|
||||
# Backup the mysql.proc table
|
||||
--enable_prepare_warnings
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
eval SELECT * FROM mysql.proc INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/proc.txt';
|
||||
--disable_prepare_warnings
|
||||
--enable_cursor_protocol
|
||||
--enable_ps2_protocol
|
||||
# Make sure we don't have any procedures left.
|
||||
delete from mysql.proc;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -333,9 +333,7 @@ SELECT * FROM mysql.column_stats;
|
||||
--sorted_result
|
||||
SELECT * FROM mysql.index_stats;
|
||||
|
||||
--disable_cursor_protocol
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_ps2_protocol
|
||||
eval
|
||||
SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/save_column_stats'
|
||||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
|
||||
@@ -345,8 +343,6 @@ eval
|
||||
SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/save_index_stats'
|
||||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
|
||||
FROM mysql.index_stats WHERE index_name IN ('idx1', 'idx4');
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
ALTER TABLE t1 CHANGE COLUMN b x varchar(30);
|
||||
SHOW CREATE TABLE t1;
|
||||
|
@@ -1,5 +1,3 @@
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
|
||||
drop view if exists v2;
|
||||
call mtr.add_suppression("Sort aborted.*");
|
||||
set @subselect_tmp=@@optimizer_switch;
|
||||
set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test,
|
||||
|
@@ -8,10 +8,6 @@
|
||||
#
|
||||
# Initialise
|
||||
--source include/have_sequence.inc
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
|
||||
drop view if exists v2;
|
||||
--enable_warnings
|
||||
|
||||
call mtr.add_suppression("Sort aborted.*");
|
||||
|
||||
@@ -1200,7 +1196,6 @@ DROP TABLE t1;
|
||||
#
|
||||
|
||||
--disable_service_connection
|
||||
--disable_ps2_protocol
|
||||
create table t1 (a int, b decimal(13, 3));
|
||||
insert into t1 values (1, 0.123);
|
||||
let $outfile_abs= $MYSQLTEST_VARDIR/tmp/subselect.out.file.1;
|
||||
@@ -1209,15 +1204,12 @@ let $outfile_rel= ../../tmp/subselect.out.file.1;
|
||||
--error 0,1
|
||||
--remove_file $outfile_abs
|
||||
--enable_warnings
|
||||
--disable_cursor_protocol
|
||||
eval select a, (select max(b) from t1) into outfile "$outfile_rel" from t1;
|
||||
--enable_cursor_protocol
|
||||
delete from t1;
|
||||
eval load data infile "$outfile_rel" into table t1;
|
||||
--remove_file $outfile_abs
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_service_connection
|
||||
|
||||
#
|
||||
@@ -3619,9 +3611,7 @@ DROP TABLE t1,t2;
|
||||
CREATE TABLE t1(a1 int);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
||||
--disable_cursor_protocol
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
--enable_cursor_protocol
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
|
||||
## First a simpler query, illustrating the transformation
|
||||
@@ -3659,9 +3649,7 @@ INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE TABLE t2(a1 int);
|
||||
INSERT INTO t2 VALUES (3);
|
||||
|
||||
--disable_cursor_protocol
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
--enable_cursor_protocol
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
|
||||
## All these are subject to the transformation
|
||||
@@ -3682,9 +3670,7 @@ DROP TABLE t1, t2;
|
||||
create table t2(i int);
|
||||
insert into t2 values(0);
|
||||
|
||||
--disable_cursor_protocol
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
--enable_cursor_protocol
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
|
||||
CREATE VIEW v1 AS
|
||||
@@ -5061,9 +5047,7 @@ INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE TABLE t2(a1 int);
|
||||
INSERT INTO t2 VALUES (3);
|
||||
|
||||
--disable_cursor_protocol
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
--enable_cursor_protocol
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
|
||||
## All these are subject to the transformation
|
||||
@@ -5080,9 +5064,7 @@ DROP TABLE t1, t2;
|
||||
create table t2(i int);
|
||||
insert into t2 values(0);
|
||||
|
||||
--disable_cursor_protocol
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
--enable_cursor_protocol
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
|
||||
CREATE VIEW v1 AS
|
||||
@@ -5475,9 +5457,7 @@ DROP TABLE t1,t2,t3;
|
||||
CREATE TABLE t1(a1 int);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
||||
--disable_cursor_protocol
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
--enable_cursor_protocol
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
|
||||
## First a simpler query, illustrating the transformation
|
||||
|
@@ -651,11 +651,7 @@ DROP TABLE t1, t2;
|
||||
|
||||
create table t1 (a int, b decimal(13, 3));
|
||||
insert into t1 values (1, 0.123);
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select a, (select max(b) from t1) into outfile "../../tmp/subselect.out.file.1" from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
delete from t1;
|
||||
load data infile "../../tmp/subselect.out.file.1" into table t1;
|
||||
select * from t1;
|
||||
|
@@ -2,8 +2,6 @@ select @@optimizer_switch like '%exists_to_in=off%';
|
||||
@@optimizer_switch like '%exists_to_in=off%'
|
||||
0
|
||||
set optimizer_switch='exists_to_in=off';
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
|
||||
drop view if exists v2;
|
||||
call mtr.add_suppression("Sort aborted.*");
|
||||
set @subselect_tmp=@@optimizer_switch;
|
||||
set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test,
|
||||
|
@@ -5,8 +5,6 @@ set optimizer_switch='materialization=off';
|
||||
set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
|
||||
set join_cache_level=1;
|
||||
set @join_cache_level_for_subselect_test=@@join_cache_level;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
|
||||
drop view if exists v2;
|
||||
call mtr.add_suppression("Sort aborted.*");
|
||||
set @subselect_tmp=@@optimizer_switch;
|
||||
set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test,
|
||||
|
@@ -1,8 +1,6 @@
|
||||
set @optimizer_switch_for_subselect_test='materialization=off,semijoin=off,subquery_cache=off,mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
|
||||
set join_cache_level=1;
|
||||
set @join_cache_level_for_subselect_test=@@join_cache_level;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
|
||||
drop view if exists v2;
|
||||
call mtr.add_suppression("Sort aborted.*");
|
||||
set @subselect_tmp=@@optimizer_switch;
|
||||
set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test,
|
||||
|
@@ -4,8 +4,6 @@ select @@optimizer_switch like '%subquery_cache=on%';
|
||||
set optimizer_switch='subquery_cache=off';
|
||||
set join_cache_level=1;
|
||||
set @join_cache_level_for_subselect_test=@@join_cache_level;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
|
||||
drop view if exists v2;
|
||||
call mtr.add_suppression("Sort aborted.*");
|
||||
set @subselect_tmp=@@optimizer_switch;
|
||||
set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test,
|
||||
|
@@ -1,8 +1,6 @@
|
||||
set @optimizer_switch_for_subselect_test='semijoin=off,mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
|
||||
set join_cache_level=1;
|
||||
set @join_cache_level_for_subselect_test=@@join_cache_level;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
|
||||
drop view if exists v2;
|
||||
call mtr.add_suppression("Sort aborted.*");
|
||||
set @subselect_tmp=@@optimizer_switch;
|
||||
set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test,
|
||||
|
@@ -15,6 +15,14 @@ CREATE TABLE t2(user_str TEXT);
|
||||
CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER());
|
||||
|
||||
---> patching t1.TRG...
|
||||
connection default;
|
||||
CREATE TABLE patch (a blob);
|
||||
LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/mysqltest_db1/t1.TRG' INTO TABLE patch;
|
||||
SELECT SUBSTRING_INDEX(a,'definers=',1) INTO OUTFILE
|
||||
'$MYSQLD_DATADIR/mysqltest_db1/t1.TRG'
|
||||
FROM patch;
|
||||
DROP TABLE patch;
|
||||
connection wl2818_definer_con;
|
||||
|
||||
CREATE TRIGGER wl2818_trg2 AFTER INSERT ON t1
|
||||
FOR EACH ROW
|
||||
|
@@ -61,23 +61,17 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUE
|
||||
# portable and we have to load the file into a table, exclude the definers line,
|
||||
# then load the data to an outfile to accomplish the same effect
|
||||
|
||||
--disable_query_log
|
||||
--connection default
|
||||
CREATE TABLE patch (a blob);
|
||||
let $MYSQLD_DATADIR = `select @@datadir`;
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/mysqltest_db1/t1.TRG' INTO TABLE patch;
|
||||
evalp LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/mysqltest_db1/t1.TRG' INTO TABLE patch;
|
||||
# remove original t1.TRG file so SELECT INTO OUTFILE won't fail
|
||||
--remove_file $MYSQLD_DATADIR/mysqltest_db1/t1.TRG
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT SUBSTRING_INDEX(a,'definers=',1) INTO OUTFILE
|
||||
evalp SELECT SUBSTRING_INDEX(a,'definers=',1) INTO OUTFILE
|
||||
'$MYSQLD_DATADIR/mysqltest_db1/t1.TRG'
|
||||
FROM patch;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
DROP TABLE patch;
|
||||
--connection wl2818_definer_con
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# Create a new trigger.
|
||||
|
@@ -740,11 +740,7 @@ FLUSH TABLES;
|
||||
# 0xFF - record flags
|
||||
# 0x77777777 - TIMESTAMP integer part
|
||||
# 0xFFFFFF - TIMESTAMP bad fractional part
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT CONCAT(0xFF,0x77777777,0xFFFFFF) INTO OUTFILE '$MYSQLD_DATADIR/test/t1.MYD' FIELDS TERMINATED BY '' ESCAPED BY '' LINES TERMINATED BY ''
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--eval SELECT HEX(LOAD_FILE('$MYSQLD_DATADIR/test/t1.MYD')) AS MYD
|
||||
--enable_query_log
|
||||
SELECT a, CAST(a AS DATETIME) AS dt0, CAST(a AS DATETIME(6)) AS dt6 FROM t1;
|
||||
|
@@ -1115,11 +1115,9 @@ DROP TABLE t1;
|
||||
-- echo # Bug#32858: Error: "Incorrect usage of UNION and INTO" does not take
|
||||
-- echo # subselects into account
|
||||
-- echo #
|
||||
--disable_ps2_protocol
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--disable_cursor_protocol
|
||||
-- echo # Tests fix in parser rule select_derived_union.
|
||||
SELECT a INTO @v FROM (
|
||||
SELECT a FROM t1
|
||||
@@ -1161,11 +1159,9 @@ SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1;
|
||||
SELECT ( SELECT a UNION SELECT a ) INTO @v FROM t1;
|
||||
SELECT ( SELECT a UNION SELECT a ) INTO OUTFILE 'union.out.file3' FROM t1;
|
||||
SELECT ( SELECT a UNION SELECT a ) INTO DUMPFILE 'union.out.file4' FROM t1;
|
||||
--enable_cursor_protocol
|
||||
|
||||
DROP TABLE t1;
|
||||
remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.1/data/test union.out.fil*;
|
||||
--enable_ps2_protocol
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49734: Crash on EXPLAIN EXTENDED UNION ... ORDER BY
|
||||
|
@@ -44,11 +44,7 @@ CREATE TABLE t2(c1 INT);
|
||||
let $prefix= `SELECT UUID()`;
|
||||
--echo # Create a file in the database directory
|
||||
--replace_result $prefix FAKE_FILE
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT 'hello' INTO OUTFILE 'fake_file.$prefix';
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--echo
|
||||
--echo # 'DROP DATABASE' will fail if there is any other file in the the
|
||||
|
@@ -229,7 +229,6 @@ connection slave;
|
||||
include/rpl_reset.inc
|
||||
connection master;
|
||||
SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (t text);
|
||||
CREATE PROCEDURE p(file varchar(4096))
|
||||
BEGIN
|
||||
|
@@ -1,7 +1,6 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection master;
|
||||
drop database if exists mysqltest1;
|
||||
create database mysqltest1;
|
||||
create table mysqltest1.t1 (n int);
|
||||
insert into mysqltest1.t1 values (1);
|
||||
|
@@ -3,9 +3,7 @@ DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 DATETIME);
|
||||
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_null.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
|
||||
--disable_cursor_protocol
|
||||
eval SELECT * INTO OUTFILE '../../tmp/t1.dat' FROM t1;
|
||||
--enable_cursor_protocol
|
||||
SELECT * FROM t1 ORDER BY c1;
|
||||
TRUNCATE TABLE t1;
|
||||
--disable_query_log
|
||||
@@ -17,9 +15,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 DATETIME);
|
||||
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_null2.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' ESCAPED BY '\'' LINES TERMINATED BY '\n';
|
||||
--disable_query_log
|
||||
--disable_cursor_protocol
|
||||
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1-2.dat' FIELDS ESCAPED BY '\'' FROM t1;
|
||||
--enable_cursor_protocol
|
||||
--enable_query_log
|
||||
SELECT * FROM t1 ORDER BY c1;
|
||||
TRUNCATE TABLE t1;
|
||||
|
@@ -173,9 +173,7 @@ select * from federated.t4;
|
||||
|
||||
select name into @var from federated.t1 where id=3 limit 1 ;
|
||||
select @var;
|
||||
--disable_ps2_protocol
|
||||
select name into outfile 'tmp.txt' from federated.t1;
|
||||
--enable_ps2_protocol
|
||||
|
||||
let $path=`select concat(@@datadir, 'test/tmp.txt')`;
|
||||
remove_file $path;
|
||||
|
@@ -3,7 +3,6 @@
|
||||
# -- Test case for Bug#21818.
|
||||
# --
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
|
||||
|
@@ -176,11 +176,9 @@ SELECT 1 AS my_col FROM information_schema.tables
|
||||
WHERE table_name = 't1_third';
|
||||
#
|
||||
# SELECT INTO USER VARIABLE
|
||||
--disable_cursor_protocol
|
||||
SELECT table_name,table_schema INTO @table_name,@table_schema
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name LIMIT 1;
|
||||
--enable_cursor_protocol
|
||||
SELECT @table_name,@table_schema;
|
||||
#
|
||||
# SELECT INTO OUTFILE
|
||||
@@ -188,16 +186,12 @@ let $OUTFILE = $MYSQLTEST_VARDIR/tmp/datadict.out;
|
||||
--error 0,1
|
||||
remove_file $OUTFILE;
|
||||
--replace_result $OUTFILE <OUTFILE>
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT table_name,table_schema
|
||||
INTO OUTFILE '$OUTFILE'
|
||||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
LINES TERMINATED BY '\n'
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
cat_file $OUTFILE;
|
||||
remove_file $OUTFILE;
|
||||
#
|
||||
|
@@ -4,10 +4,6 @@
|
||||
--echo # --
|
||||
--echo
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
|
||||
@@ -18,11 +14,7 @@ INSERT INTO t1 VALUES (1), (2), (3);
|
||||
--enable_info
|
||||
--echo SELECT * FROM t1 INTO OUTFILE "MYSQL_TMP_DIR/bug21818.txt";
|
||||
--disable_query_log # to avoid $MYSQL_TMP_DIR in query log
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT * FROM t1 INTO OUTFILE "$MYSQL_TMP_DIR/bug21818.txt"
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--enable_query_log
|
||||
--disable_info
|
||||
|
||||
@@ -34,11 +26,9 @@ SELECT ROW_COUNT();
|
||||
--echo
|
||||
--echo # -- Check 2.
|
||||
|
||||
--disable_cursor_protocol
|
||||
--enable_info
|
||||
SELECT a FROM t1 LIMIT 1 INTO @a;
|
||||
--disable_info
|
||||
--enable_cursor_protocol
|
||||
|
||||
--echo
|
||||
--disable_ps2_protocol
|
||||
|
@@ -626,11 +626,7 @@ CREATE TABLE t1 (
|
||||
);
|
||||
|
||||
INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101');
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT pk, b INTO OUTFILE 'load.data' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error ER_DATA_TOO_LONG
|
||||
LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b);
|
||||
|
||||
|
@@ -782,11 +782,7 @@ CREATE TABLE t1 (
|
||||
);
|
||||
|
||||
INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101');
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT pk, b INTO OUTFILE 'load.data' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error ER_DATA_TOO_LONG
|
||||
LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b);
|
||||
|
||||
|
@@ -674,11 +674,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, a VARCHAR(2333),
|
||||
va VARCHAR(171) AS (a)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 (id,a) VALUES (1,REPEAT('x',200));
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT id, va INTO OUTFILE 'load_t1' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error ER_DATA_TOO_LONG
|
||||
LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id,va);
|
||||
SELECT * FROM t1;
|
||||
@@ -691,11 +687,7 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (id BIGINT PRIMARY KEY, a VARCHAR(2333),
|
||||
va VARCHAR(171) AS (a)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 (id,a) VALUES (1,REPEAT('x',200));
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT id, va INTO OUTFILE 'load_t1' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error ER_DATA_TOO_LONG
|
||||
LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id,va);
|
||||
SELECT * FROM t1;
|
||||
@@ -715,11 +707,7 @@ CREATE TABLE t1 (id INT PRIMARY KEY,
|
||||
ts TIMESTAMP DEFAULT '1971-01-01 00:00:00',
|
||||
c VARBINARY(8) DEFAULT '', vc VARCHAR(3) AS (c) STORED);
|
||||
INSERT IGNORE INTO t1 (id,c) VALUES (1,'foobar');
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT id, ts, vc INTO OUTFILE 'load_t1' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error 0,ER_DATA_TOO_LONG
|
||||
LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id, ts, vc);
|
||||
INSERT IGNORE INTO t1 (id) VALUES (2);
|
||||
|
@@ -560,11 +560,7 @@ DROP TABLE t;
|
||||
--echo #
|
||||
CREATE TABLE t (id INT) ENGINE=InnoDB;
|
||||
--replace_result $MYSQLTEST_VARDIR VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select 1 into outfile "$MYSQLTEST_VARDIR/tmp/t.outfile";
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
BEGIN;
|
||||
--replace_result $MYSQLTEST_VARDIR VARDIR
|
||||
eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t.outfile' INTO TABLE t;
|
||||
|
@@ -130,11 +130,7 @@ INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES
|
||||
INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES ('impact', 'b', 'h', 185, 'fj', 7, 7, 3);
|
||||
|
||||
ALTER TABLE t1 ADD COLUMN filler VARCHAR(255) DEFAULT '';
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT * INTO OUTFILE 'load.data' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
UPDATE IGNORE t1 SET pk = 0;
|
||||
LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1;
|
||||
HANDLER t1 OPEN AS h;
|
||||
|
@@ -142,12 +142,7 @@ update ignore t5 set c1 = 20 where c1 = 140 ;
|
||||
select count(*) from t5 where c1 = 140;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select * into outfile "$MYSQLTEST_VARDIR/tmp/t5.outfile" from t5;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
|
||||
create temporary table temp_1 engine = innodb as select * from t5 where 1=2;
|
||||
select count(*) from temp_1;
|
||||
|
@@ -264,22 +264,14 @@ insert into t values (1, '2020-03-03', '2020-03-10')
|
||||
on duplicate key update x = 2;
|
||||
|
||||
select * from t;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 'tmp_t.txt' from t;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
load data infile 'tmp_t.txt' into table t;
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
load data infile 'tmp_t.txt' replace into table t;
|
||||
remove_file $MYSQLD_DATADIR/test/tmp_t.txt;
|
||||
|
||||
insert into t values (1, '2020-03-01', '2020-03-05');
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 'tmp_t.txt' from t;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error ER_DUP_ENTRY
|
||||
load data infile 'tmp_t.txt' into table t;
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection master;
|
||||
drop database if exists mysqltest1;
|
||||
create database mysqltest1;
|
||||
create table mysqltest1.t1 (n int);
|
||||
insert into mysqltest1.t1 values (1);
|
||||
|
@@ -1,6 +1,11 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
==== Create a big file ====
|
||||
SET @@sql_log_bin= 0;
|
||||
create table t1 (id int not null primary key auto_increment);
|
||||
select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
|
||||
DROP TABLE t1;
|
||||
SET @@sql_log_bin= 1;
|
||||
==== Load our big file into a table ====
|
||||
create table t2 (id int not null primary key auto_increment);
|
||||
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
|
||||
|
@@ -229,7 +229,6 @@ connection slave;
|
||||
include/rpl_reset.inc
|
||||
connection master;
|
||||
SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (t text);
|
||||
CREATE PROCEDURE p(file varchar(4096))
|
||||
BEGIN
|
||||
|
@@ -58,11 +58,7 @@ SET @old_debug= @@global.debug_dbug;
|
||||
-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
|
||||
-- let $MYSQLD_DATADIR= `select @@datadir`
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
### ACTION: create a small file (< 4096 bytes) that will be later used
|
||||
### in LOAD DATA INFILE to check for absence of binlog errors
|
||||
@@ -71,11 +67,7 @@ SET @old_debug= @@global.debug_dbug;
|
||||
-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
|
||||
-- let $MYSQLD_DATADIR= `select @@datadir`
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
|
@@ -4,19 +4,12 @@
|
||||
-- source include/master-slave.inc
|
||||
connection master;
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists mysqltest1;
|
||||
--enable_warnings
|
||||
create database mysqltest1;
|
||||
create table mysqltest1.t1 (n int);
|
||||
insert into mysqltest1.t1 values (1);
|
||||
--disable_cursor_protocol
|
||||
--enable_prepare_warnings
|
||||
--disable_ps2_protocol
|
||||
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
|
||||
--disable_prepare_warnings
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
create table mysqltest1.t2 (n int);
|
||||
create table mysqltest1.t3 (n int);
|
||||
--replace_result \\ / 66 39 93 39 17 39 247 39 41 39 "File exists" "Directory not empty"
|
||||
|
@@ -27,11 +27,7 @@ set SQL_LOG_BIN=1;
|
||||
enable_query_log;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
#This will generate a 20KB file, now test LOAD DATA LOCAL
|
||||
truncate table t1;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
@@ -54,11 +50,7 @@ connection master;
|
||||
create table t1(a int);
|
||||
insert into t1 values (1), (2), (2), (3);
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
drop table t1;
|
||||
create table t1(a int primary key);
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
@@ -87,11 +79,7 @@ SET sql_mode='ignore_space';
|
||||
CREATE TABLE t1(a int);
|
||||
insert into t1 values (1), (2), (3), (4);
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
truncate table t1;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
@@ -125,11 +113,7 @@ CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4);
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug43746.sql' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
@@ -177,11 +161,7 @@ sync_slave_with_master;
|
||||
connection master;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
@@ -226,11 +206,7 @@ CREATE VIEW v1 AS SELECT * FROM t2
|
||||
WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
|
||||
|
@@ -26,26 +26,22 @@ source include/master-slave.inc;
|
||||
# just an auxiliary construction anyways, it is not needed on the
|
||||
# slave.
|
||||
|
||||
--disable_query_log
|
||||
SET @@sql_log_bin= 0;
|
||||
|
||||
let $rows= 5000;
|
||||
create table t1 (id int not null primary key auto_increment);
|
||||
|
||||
--disable_query_log
|
||||
let $rows= 5000;
|
||||
while($rows)
|
||||
{
|
||||
eval insert into t1 values (null);
|
||||
dec $rows;
|
||||
}
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--enable_query_log
|
||||
evalp select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
SET @@sql_log_bin= 1;
|
||||
--enable_query_log
|
||||
|
||||
|
||||
--echo ==== Load our big file into a table ====
|
||||
|
@@ -69,15 +69,7 @@ connection master;
|
||||
let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
--eval SELECT repeat('x',20) INTO OUTFILE '$file'
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
disable_warnings;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
enable_warnings;
|
||||
|
||||
CREATE TABLE t1 (t text);
|
||||
DELIMITER |;
|
||||
|
@@ -26,11 +26,7 @@ insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
|
||||
--disable_warnings
|
||||
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
|
||||
--enable_warnings
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 'rpl_misc_functions.outfile' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
sync_slave_with_master;
|
||||
create temporary table t2 like t1;
|
||||
@@ -95,12 +91,8 @@ INSERT INTO t1 (col_a) VALUES (test_replication_sf());
|
||||
|
||||
--enable_prepare_warnings
|
||||
# Dump table on slave
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * from t1 into outfile "../../tmp/t1_slave.txt";
|
||||
--disable_prepare_warnings
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
# Load data from slave into temp table on master
|
||||
connection master;
|
||||
|
@@ -26,9 +26,7 @@ my $protected_file= dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt';
|
||||
# test runs).
|
||||
unlink $protected_file;
|
||||
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/bug50373.inc") or die;
|
||||
print FILE "--disable_ps2_protocol\n";
|
||||
print FILE "SELECT * FROM t1 INTO OUTFILE '".$protected_file."';\n";
|
||||
print FILE "--enable_ps2_protocol\n";
|
||||
print FILE "DELETE FROM t1;\n";
|
||||
print FILE "LOAD DATA INFILE '".$protected_file."' INTO TABLE t1;\n";
|
||||
print FILE "SELECT * FROM t1;\n";
|
||||
|
@@ -5,11 +5,7 @@ create table t1 ( c1 varchar(10), c2 varchar(10), c3 int );
|
||||
insert into t1 values ("a" , "b", 1), ("a" , "b", 2);
|
||||
create table t2 like t1 ;
|
||||
alter table t2 add column c4 bigint unsigned as (CONV(LEFT(MD5(concat(c1,c2,c3)), 16), 16, 10)) persistent unique key;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 't1.csv' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
load data infile 't1.csv' ignore into table t2 ;
|
||||
select * from t2;
|
||||
insert into t2 (c1,c2,c3) values ("a" , "b", 4);
|
||||
|
@@ -281,11 +281,7 @@ drop table t1;
|
||||
CREATE TABLE t1 (i INT, d1 DATE, d2 DATE NOT NULL, t TIMESTAMP, KEY(t)) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1,'2023-03-16','2023-03-15','2012-12-12 12:12:12');
|
||||
ALTER TABLE t1 MODIFY t FLOAT AS (i) PERSISTENT;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT i, d1, d2 INTO OUTFILE 'load_t1' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
DELETE FROM t1;
|
||||
LOAD DATA INFILE 'load_t1' INTO TABLE t1 (i,d1,d2);
|
||||
SELECT * FROM t1 WHERE d2 < d1;
|
||||
|
@@ -401,27 +401,15 @@ INSERT INTO t2 VALUES (1,'against'),(2,'q');
|
||||
|
||||
SET SQL_MODE= '';
|
||||
SET timestamp = 2;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT * INTO OUTFILE 't1.data' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
SET timestamp = 3;
|
||||
UPDATE t1 SET f13 = 'q';
|
||||
SET timestamp = 4;
|
||||
LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT * INTO OUTFILE 't1.data.2' FROM t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
SET timestamp = 5;
|
||||
LOAD DATA INFILE 't1.data.2' REPLACE INTO TABLE t1;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
SELECT * INTO OUTFILE 't2.data' FROM t2;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
SET timestamp = 6;
|
||||
LOAD DATA INFILE 't2.data' REPLACE INTO TABLE t2;
|
||||
SET FOREIGN_KEY_CHECKS = OFF;
|
||||
@@ -564,11 +552,7 @@ delete from t0;
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
replace t0 values (1);
|
||||
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 'load_t0' from t0 ;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
load data infile 'load_t0' replace into table t0;
|
||||
|
||||
|
@@ -196,11 +196,7 @@ replace into t3 values (0, '1980-01-01 00:00:00', '1981-01-01 00:00:00');
|
||||
--echo # LOAD DATA
|
||||
--let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data
|
||||
--replace_result $DATAFILE DATAFILE
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
create or replace table t2 like t1;
|
||||
--replace_result $default_engine DEFAULT_ENGINE
|
||||
show create table t2;
|
||||
@@ -257,11 +253,7 @@ set sql_mode='STRICT_ALL_TABLES';
|
||||
create or replace table t1 (a int) with system versioning;
|
||||
set system_versioning_insert_history= on;
|
||||
insert into t1 (a,row_start,row_end) values (1,'2022-01-01','2023-01-01'),(1,'2022-01-01','2023-01-01');
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select a,row_start,row_end into outfile 'mdev29813.txt' from t1 for system_time all;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
create or replace table t1 (a int primary key) with system versioning;
|
||||
load data infile 'mdev29813.txt' ignore into table t1 (a,row_start,row_end);
|
||||
|
@@ -1020,16 +1020,12 @@ create or replace table t1 (
|
||||
|
||||
insert into t1 () values (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();
|
||||
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select * into outfile 'MDEV-17891.data' from t1;
|
||||
--enable_ps2_protocol
|
||||
load data infile 'MDEV-17891.data' replace into table t1;
|
||||
--error ER_RECORD_FILE_FULL
|
||||
load data infile 'MDEV-17891.data' replace into table t1;
|
||||
--error ER_RECORD_FILE_FULL
|
||||
load data infile 'MDEV-17891.data' replace into table t1;
|
||||
--enable_cursor_protocol
|
||||
|
||||
# Cleanup
|
||||
--remove_file $datadir/test/MDEV-17891.data
|
||||
@@ -1370,11 +1366,7 @@ partition by system_time limit 100 (
|
||||
partition pn current);
|
||||
|
||||
insert into t1 select seq from seq_0_to_49;
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select x into outfile 'MDEV-20077.data' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
load data infile 'MDEV-20077.data' replace into table t1 (x);
|
||||
load data infile 'MDEV-20077.data' replace into table t1 (x);
|
||||
@@ -2213,11 +2205,7 @@ create or replace table t1 (x int primary key) with system versioning
|
||||
partition by system_time interval 1 hour auto;
|
||||
|
||||
insert t1 values (1), (2), (3);
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select x into outfile 'MDEV-17554.data' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
|
||||
set timestamp= unix_timestamp('2000-01-01 01:00:00');
|
||||
load data infile 'MDEV-17554.data' replace into table t1 (x);
|
||||
|
@@ -93,11 +93,7 @@ if ($default_engine == MEMORY)
|
||||
create table t1 (a int, b int, c int, vc int as (c), unique(a), unique(b)) with system versioning;
|
||||
insert ignore into t1 (a,b,c) values (1,2,3);
|
||||
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
select a, b, c into outfile '15330.data' from t1;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
load data infile '15330.data' ignore into table t1 (a,b,c);
|
||||
load data infile '15330.data' replace into table t1 (a,b,c);
|
||||
--let $datadir=`select @@datadir`
|
||||
|
@@ -414,11 +414,7 @@ select row_start = '1980-01-01 00:00:00', row_end = '1980-01-01 00:00:01' from t
|
||||
connection master;
|
||||
--let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data
|
||||
--replace_result $DATAFILE DATAFILE
|
||||
--disable_cursor_protocol
|
||||
--disable_ps2_protocol
|
||||
eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all;
|
||||
--enable_ps2_protocol
|
||||
--enable_cursor_protocol
|
||||
create or replace table t3 like t1;
|
||||
set @@system_versioning_insert_history= 1;
|
||||
--replace_result $DATAFILE DATAFILE
|
||||
|
Reference in New Issue
Block a user