~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings

--echo #
--echo # Bug#31663 FIELDS TERMINATED BY special character
--echo #

CREATE TABLE t1 (i1 int, i2 int, c1 VARCHAR(256), c2 VARCHAR(256));
INSERT INTO t1 VALUES (101, 202, '-r-', '=raker=');

--let $fields=*
--let $clauses=FIELDS TERMINATED BY 'raker'
--echo # $clauses, error:

--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--error ER_AMBIGUOUS_FIELD_TERM
--eval SELECT $fields INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1

--let $fields=i1, i2
--let $clauses=FIELDS TERMINATED BY 'r'
--echo # Only numeric fields, $clauses, no warnings:

--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--eval SELECT $fields INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--eval SELECT LOAD_FILE('$DRIZZLETEST_VARDIR/tmp/bug31663.txt')
--eval CREATE TABLE t2 SELECT $fields FROM t1
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--eval LOAD DATA INFILE '$DRIZZLETEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
--eval SELECT $fields FROM t2
--remove_file $DRIZZLETEST_VARDIR/tmp/bug31663.txt
DROP TABLE t2;

--let $fields=*
--let $clauses=FIELDS TERMINATED BY '0'
--echo # $clauses, warning:

--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--error ER_AMBIGUOUS_FIELD_TERM
--eval SELECT $fields INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1

--let $fields=*
--let $clauses=FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0'
--echo # $clauses, warning:

--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--error ER_AMBIGUOUS_FIELD_TERM
--eval SELECT $fields INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1

# Drizzle bug (not filed, fixed): assert on file not found
--eval CREATE TABLE t2 SELECT $fields FROM t1
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--error ER_FILE_NOT_FOUND
--eval LOAD DATA INFILE '$DRIZZLETEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
DROP TABLE t2;

--let $fields=c1, c2
--let $clauses=FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0'
--echo # Only string fields, $clauses, no warnings:

--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--eval SELECT $fields INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--eval SELECT LOAD_FILE('$DRIZZLETEST_VARDIR/tmp/bug31663.txt')
--eval CREATE TABLE t2 SELECT $fields FROM t1
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
--eval LOAD DATA INFILE '$DRIZZLETEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
--eval SELECT $fields FROM t2
--remove_file $DRIZZLETEST_VARDIR/tmp/bug31663.txt
DROP TABLE t2;

DROP TABLE t1;

--echo #
--echo # Bug#32533: SELECT INTO OUTFILE never escapes multibyte character
--echo #

# Disabled due to  https://bugs.launchpad.net/mysql-server/+bug/308457

#CREATE TABLE t1 (c1 VARCHAR(256));
#INSERT INTO t1 (c1) VALUES ('☠');
#SELECT HEX(c1) FROM t1;

#--let $file=$DRIZZLETEST_VARDIR/tmp/bug32533.txt

#--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
#--eval SELECT * INTO OUTFILE '$file' FIELDS ENCLOSED BY '☢' FROM t1
#TRUNCATE t1;

#--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
#--eval SELECT HEX(LOAD_FILE('$file'))

#--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
#--eval LOAD DATA INFILE '$file' INTO TABLE t1 FIELDS ENCLOSED BY '☢'
#SELECT HEX(c1) FROM t1;

#--remove_file $file
#DROP TABLE t1;

--echo # End of 5.0 tests.