Commit 17678a7b authored by unknown's avatar unknown
Browse files

item_func.cc:

set_var.cc:
variables.result
variables.test

  Bug #10904 Illegal mix of collations between a system variable and a constant
  Changing coercibility of system variables to SYSCONST,
  to be the same with USER(), DATABASE(), etc.


sql/item_func.cc:
  Bug #10904 Illegal mix of collations between a system variable and a constant
  Changing coercibility of system variables to SYSCONST
  To be the same with USER(), DATABASE(), etc.
parent d7d3be6b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -210,6 +210,12 @@ query_prealloc_size 8192
range_alloc_block_size	2048
transaction_alloc_block_size	8192
transaction_prealloc_size	4096
SELECT @@version LIKE 'non-existent';
@@version LIKE 'non-existent'
0
SELECT @@version_compile_os LIKE 'non-existent';
@@version_compile_os LIKE 'non-existent'
0
set big_tables=OFFF;
ERROR 42000: Variable 'big_tables' can't be set to the value of 'OFFF'
set big_tables="OFFF";
+7 −0
Original line number Diff line number Diff line
@@ -115,6 +115,13 @@ set @@query_alloc_block_size=default, @@query_prealloc_size=default;
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
show variables like '%alloc%';

#
# Bug #10904 Illegal mix of collations between
# a system variable and a constant
#
SELECT @@version LIKE 'non-existent';
SELECT @@version_compile_os LIKE 'non-existent';

# The following should give errors

--error 1231
+1 −1
Original line number Diff line number Diff line
@@ -3369,7 +3369,7 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name,
      !my_strcasecmp(system_charset_info, name.str, "VERSION"))
    return new Item_string("@@VERSION", server_version,
			   (uint) strlen(server_version),
			   system_charset_info);
			   system_charset_info, DERIVATION_SYSCONST);

  Item *item;
  sys_var *var;
+2 −1
Original line number Diff line number Diff line
@@ -1606,7 +1606,8 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base)
    Item_string *tmp;
    pthread_mutex_lock(&LOCK_global_system_variables);
    char *str= (char*) value_ptr(thd, var_type, base);
    tmp= new Item_string(str, strlen(str), system_charset_info);
    tmp= new Item_string(str, strlen(str),
                         system_charset_info, DERIVATION_SYSCONST);
    pthread_mutex_unlock(&LOCK_global_system_variables);
    return tmp;
  }