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);
11
select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8'')));
14
12
# Test for core dump with nan
52
44
show create table t1;
56
# Bug #30832: Assertion + crash with select name_const('test',now());
58
--error ER_WRONG_ARGUMENTS
59
SELECT NAME_CONST('test', NOW());
60
--error ER_WRONG_ARGUMENTS
61
SELECT NAME_CONST('test', UPPER('test'));
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');
71
# Bug #34749: Server crash when using NAME_CONST() with an aggregate function
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;
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
93
CREATE TABLE t1 (a int);
94
INSERT INTO t1 VALUES (5), (2);
96
--error ER_WRONG_ARGUMENTS
97
SELECT NAME_CONST(x,2) FROM (SELECT a x FROM t1) t;
103
# Bug #32559: connection hangs on query with name_const
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);
114
# BUG#34289 - Incorrect NAME_CONST substitution in stored procedures breaks
117
SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
119
47
--echo End of 5.0 tests