~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_misc.test

MergeĀ fromĀ Jim

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
10
10
 
 
11
select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8'')));
 
12
 
11
13
#
12
14
# Test for core dump with nan
13
15
#
32
34
 
33
35
drop table t1;
34
36
 
 
37
 
 
38
#
 
39
# Bug #21531: EXPORT_SET() doesn't accept args with coercible character sets
 
40
#
 
41
select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
 
42
 
35
43
--echo End of 4.1 tests
36
44
 
37
45
 
44
52
show create table t1;
45
53
drop table t1;
46
54
 
 
55
#
 
56
# Bug #30832: Assertion + crash with select name_const('test',now());
 
57
#
 
58
--error ER_WRONG_ARGUMENTS
 
59
SELECT NAME_CONST('test', NOW());
 
60
--error ER_WRONG_ARGUMENTS
 
61
SELECT NAME_CONST('test', UPPER('test'));
 
62
 
 
63
SELECT NAME_CONST('test', NULL);
 
64
SELECT NAME_CONST('test', 1);
 
65
SELECT NAME_CONST('test', -1);
 
66
SELECT NAME_CONST('test', 1.0);
 
67
SELECT NAME_CONST('test', -1.0);
 
68
SELECT NAME_CONST('test', 'test');
 
69
 
 
70
#
 
71
# Bug #34749: Server crash when using NAME_CONST() with an aggregate function
 
72
#
 
73
 
 
74
CREATE TABLE t1 (a INT);
 
75
INSERT INTO t1 VALUES (1),(2),(3);
 
76
# NAME_CONST() + aggregate.
 
77
SELECT NAME_CONST('flag',1)    * MAX(a) FROM t1;
 
78
SELECT NAME_CONST('flag',1.5)  * MAX(a) FROM t1;
 
79
# Now, wrap the INT_ITEM in Item_func_neg and watch the pretty explosions
 
80
SELECT NAME_CONST('flag',-1)   * MAX(a) FROM t1;
 
81
SELECT NAME_CONST('flag',-1.5) * MAX(a) FROM t1;
 
82
--error ER_WRONG_ARGUMENTS
 
83
SELECT NAME_CONST('flag', SQRT(4)) * MAX(a) FROM t1;
 
84
--error ER_WRONG_ARGUMENTS
 
85
SELECT NAME_CONST('flag',-SQRT(4)) * MAX(a) FROM t1;
 
86
DROP TABLE t1;
 
87
 
 
88
#
 
89
# Bug #27545: erroneous usage of NAME_CONST with a name as the first parameter 
 
90
#             resolved against a column name of a derived table hangs the client
 
91
#
 
92
 
 
93
CREATE TABLE t1 (a int);
 
94
INSERT INTO t1 VALUES (5), (2);
 
95
 
 
96
--error ER_WRONG_ARGUMENTS
 
97
SELECT NAME_CONST(x,2) FROM (SELECT a x FROM t1) t;
 
98
 
 
99
DROP TABLE t1;
 
100
 
 
101
 
 
102
#
 
103
# Bug #32559: connection hangs on query with name_const
 
104
#
 
105
CREATE TABLE t1(a INT);
 
106
INSERT INTO t1 VALUES (), (), ();
 
107
--error ER_WRONG_ARGUMENTS
 
108
SELECT NAME_CONST(a, '1') FROM t1;
 
109
--error ER_WRONG_ARGUMENTS
 
110
SET INSERT_ID= NAME_CONST(a, a);
 
111
DROP TABLE t1;
 
112
 
 
113
#
 
114
# BUG#34289 - Incorrect NAME_CONST substitution in stored procedures breaks
 
115
# replication
 
116
#
 
117
SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
 
118
 
47
119
--echo End of 5.0 tests
48
120
 
49
121
#