1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-15630 uuid() function evaluates at wrong time in query

This commit is contained in:
Alexander Barkov
2018-04-03 16:28:52 +04:00
parent bdab8b74ff
commit 606e21867c
3 changed files with 24 additions and 0 deletions

View File

@ -572,6 +572,17 @@ N AVG
0 NULL 0 NULL
drop table t1; drop table t1;
# #
# MDEV-15630 uuid() function evaluates at wrong time in query
#
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
COUNT(1) uid
1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
DROP TABLE t1;
#
# End of 5.5 tests # End of 5.5 tests
# #
SELECT NAME_CONST('a', -(1 OR 2)) OR 1; SELECT NAME_CONST('a', -(1 OR 2)) OR 1;

View File

@ -596,6 +596,18 @@ AND 57813X540X1723 = 'Test';
drop table t1; drop table t1;
--echo #
--echo # MDEV-15630 uuid() function evaluates at wrong time in query
--echo #
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
--replace_column 2 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
DROP TABLE t1;
--echo # --echo #
--echo # End of 5.5 tests --echo # End of 5.5 tests
--echo # --echo #

View File

@ -997,6 +997,7 @@ public:
DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
fix_char_length(MY_UUID_STRING_LENGTH); fix_char_length(MY_UUID_STRING_LENGTH);
} }
table_map used_tables() const { return RAND_TABLE_BIT; }
const char *func_name() const{ return "uuid"; } const char *func_name() const{ return "uuid"; }
String *val_str(String *); String *val_str(String *);
bool check_vcol_func_processor(uchar *int_arg) bool check_vcol_func_processor(uchar *int_arg)