1
by brian
clean slate |
1 |
--disable_warnings
|
2 |
DROP TABLE IF EXISTS t1, t2; |
|
3 |
--enable_warnings
|
|
4 |
||
5 |
--echo #
|
|
6 |
--echo # Bug#31663 FIELDS TERMINATED BY special character
|
|
7 |
--echo #
|
|
8 |
||
9 |
CREATE TABLE t1 (i1 int, i2 int, c1 VARCHAR(256), c2 VARCHAR(256)); |
|
10 |
INSERT INTO t1 VALUES (101, 202, '-r-', '=raker='); |
|
11 |
||
12 |
--let $fields=*
|
|
13 |
--let $clauses=FIELDS TERMINATED BY 'raker'
|
|
14 |
--echo # $clauses, warning:
|
|
15 |
||
16 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
17 |
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
|
18 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
19 |
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
|
|
20 |
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
|
21 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
22 |
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
|
|
23 |
--eval SELECT $fields FROM t2
|
|
24 |
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
|
|
25 |
DROP TABLE t2; |
|
26 |
||
27 |
--let $fields=i1, i2
|
|
28 |
--let $clauses=FIELDS TERMINATED BY 'r'
|
|
29 |
--echo # Only numeric fields, $clauses, no warnings:
|
|
30 |
||
31 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
32 |
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
|
33 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
34 |
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
|
|
35 |
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
|
36 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
37 |
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
|
|
38 |
--eval SELECT $fields FROM t2
|
|
39 |
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
|
|
40 |
DROP TABLE t2; |
|
41 |
||
42 |
--let $fields=*
|
|
43 |
--let $clauses=FIELDS TERMINATED BY '0'
|
|
44 |
--echo # $clauses, warning:
|
|
45 |
||
46 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
47 |
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
|
48 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
49 |
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
|
|
50 |
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
|
51 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
52 |
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
|
|
53 |
--eval SELECT $fields FROM t2
|
|
54 |
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
|
|
55 |
DROP TABLE t2; |
|
56 |
||
57 |
--let $fields=*
|
|
58 |
--let $clauses=FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0'
|
|
59 |
--echo # $clauses, warning:
|
|
60 |
||
61 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
62 |
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
|
63 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
64 |
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
|
|
65 |
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
|
66 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
67 |
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
|
|
68 |
--eval SELECT $fields FROM t2
|
|
69 |
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
|
|
70 |
DROP TABLE t2; |
|
71 |
||
72 |
--let $fields=c1, c2
|
|
73 |
--let $clauses=FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0'
|
|
74 |
--echo # Only string fields, $clauses, no warnings:
|
|
75 |
||
76 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
77 |
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
|
|
78 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
79 |
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
|
|
80 |
--eval CREATE TABLE t2 SELECT $fields FROM t1
|
|
81 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
82 |
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
|
|
83 |
--eval SELECT $fields FROM t2
|
|
84 |
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
|
|
85 |
DROP TABLE t2; |
|
86 |
||
87 |
DROP TABLE t1; |
|
88 |
||
89 |
--echo #
|
|
90 |
--echo # Bug#32533: SELECT INTO OUTFILE never escapes multibyte character
|
|
91 |
--echo #
|
|
92 |
||
93 |
CREATE TABLE t1 (c1 VARCHAR(256)); |
|
94 |
INSERT INTO t1 VALUES (0xC3); |
|
95 |
SELECT HEX(c1) FROM t1; |
|
96 |
||
97 |
--let $file=$MYSQLTEST_VARDIR/tmp/bug32533.txt
|
|
98 |
||
99 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
100 |
--eval SELECT * INTO OUTFILE '$file' FIELDS ENCLOSED BY 0xC3 FROM t1
|
|
101 |
TRUNCATE t1; |
|
102 |
||
103 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
104 |
--eval SELECT HEX(LOAD_FILE('$file'))
|
|
105 |
||
106 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
107 |
--eval LOAD DATA INFILE '$file' INTO TABLE t1 FIELDS ENCLOSED BY 0xC3
|
|
108 |
SELECT HEX(c1) FROM t1; |
|
109 |
||
110 |
--remove_file $file
|
|
111 |
DROP TABLE t1; |
|
112 |
||
113 |
--echo # End of 5.0 tests.
|