~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/t/func_misc.test

  • Committer: Monty Taylor
  • Date: 2008-07-01 14:33:36 UTC
  • mto: (28.1.12 backport_patch)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: monty@inaugust.com-20080701143336-8uihm7dhpu92rt0q
Somehow missed moving password.c. Duh.

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
 
 
13
# As we can assume we are the only user for the mysqld server, the difference
 
14
# between two calls should be -1
 
15
set @a= uuid_short();
 
16
set @b= uuid_short();
 
17
select cast(@a - @b as signed);
 
18
 
11
19
#
12
20
# Test for core dump with nan
13
21
#
32
40
 
33
41
drop table t1;
34
42
 
 
43
 
 
44
#
 
45
# Bug #21531: EXPORT_SET() doesn't accept args with coercible character sets
 
46
#
 
47
select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
 
48
 
35
49
--echo End of 4.1 tests
36
50
 
37
51
 
44
58
show create table t1;
45
59
drop table t1;
46
60
 
 
61
#
 
62
# Bug #30832: Assertion + crash with select name_const('test',now());
 
63
#
 
64
--error ER_WRONG_ARGUMENTS
 
65
SELECT NAME_CONST('test', NOW());
 
66
--error ER_WRONG_ARGUMENTS
 
67
SELECT NAME_CONST('test', UPPER('test'));
 
68
 
 
69
SELECT NAME_CONST('test', NULL);
 
70
SELECT NAME_CONST('test', 1);
 
71
SELECT NAME_CONST('test', -1);
 
72
SELECT NAME_CONST('test', 1.0);
 
73
SELECT NAME_CONST('test', -1.0);
 
74
SELECT NAME_CONST('test', 'test');
 
75
 
 
76
#
 
77
# Bug #34749: Server crash when using NAME_CONST() with an aggregate function
 
78
#
 
79
 
 
80
CREATE TABLE t1 (a INT);
 
81
INSERT INTO t1 VALUES (1),(2),(3);
 
82
# NAME_CONST() + aggregate.
 
83
SELECT NAME_CONST('flag',1)    * MAX(a) FROM t1;
 
84
SELECT NAME_CONST('flag',1.5)  * MAX(a) FROM t1;
 
85
# Now, wrap the INT_ITEM in Item_func_neg and watch the pretty explosions
 
86
SELECT NAME_CONST('flag',-1)   * MAX(a) FROM t1;
 
87
SELECT NAME_CONST('flag',-1.5) * MAX(a) FROM t1;
 
88
--error ER_WRONG_ARGUMENTS
 
89
SELECT NAME_CONST('flag', SQRT(4)) * MAX(a) FROM t1;
 
90
--error ER_WRONG_ARGUMENTS
 
91
SELECT NAME_CONST('flag',-SQRT(4)) * MAX(a) FROM t1;
 
92
DROP TABLE t1;
 
93
 
 
94
#
 
95
# Bug #27545: erroneous usage of NAME_CONST with a name as the first parameter 
 
96
#             resolved against a column name of a derived table hangs the client
 
97
#
 
98
 
 
99
CREATE TABLE t1 (a int);
 
100
INSERT INTO t1 VALUES (5), (2);
 
101
 
 
102
--error ER_WRONG_ARGUMENTS
 
103
SELECT NAME_CONST(x,2) FROM (SELECT a x FROM t1) t;
 
104
 
 
105
DROP TABLE t1;
 
106
 
 
107
 
 
108
#
 
109
# Bug #32559: connection hangs on query with name_const
 
110
#
 
111
CREATE TABLE t1(a INT);
 
112
INSERT INTO t1 VALUES (), (), ();
 
113
--error ER_WRONG_ARGUMENTS
 
114
SELECT NAME_CONST(a, '1') FROM t1;
 
115
--error ER_WRONG_ARGUMENTS
 
116
SET INSERT_ID= NAME_CONST(a, a);
 
117
DROP TABLE t1;
 
118
 
 
119
#
 
120
# BUG#34289 - Incorrect NAME_CONST substitution in stored procedures breaks
 
121
# replication
 
122
#
 
123
SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
 
124
 
47
125
--echo End of 5.0 tests
48
126
 
49
127
#