• unknown's avatar
    type_blob.result, func_system.result, func_str.result, ctype_collate.result: · c56d0283
    unknown authored
      fixing test results accordingly.
    func_system.test:
      New test that illegal mix of collations does not happen anymore.
    item_strfunc.h:
        safe_charset_converter() was added for system constants.
    item_strfunc.cc:
      safe_charset_converter() was added for system constants.
    item_func.cc, item.h, item.cc:
      Bug#8291: Illegal collation mix with USER() function.
      After discussion with PeterG and Serge, a new coercibility
      level for "system constants" was introduced, between
      COERRIBLE and IMPLICIT. Thus:
      SELECT col1 = USER() FROM t1; - is done according to col1 collation.
      SELECT 'string' = USER(); - is done according to USER() collation.
      At the same time, "nagg" and "strong" members were removed as unused.
    item_create.cc:
      Version is a system constant too.
    
    
    sql/item.cc:
      Bug#8291: Illegal collation mix with USER() function.
      After discussion with PeterG and Serge, a new coercibility
      level for "system constants" was introduced, between
      COERRIBLE and IMPLICIT. Thus:
      SELECT col1 = USER() FROM t1; - is done according to col1 collation.
      SELECT 'string' = USER(); - is done according to USER() collation.
      At the same time, "nagg" and "strong" members were removed as unused.
    sql/item.h:
      Bug#8291: Illegal collation mix with USER() function.
      After discussion with PeterG and Serge, a new coercibility
      level for "system constants" was introduced, between
      COERRIBLE and IMPLICIT. Thus:
      SELECT col1 = USER() FROM t1; - is done according to col1 collation.
      SELECT 'string' = USER(); - is done according to USER() collation.
      At the same time, "nagg" and "strong" members were removed as unused.
    sql/item_create.cc:
      Version is a system constant too.
    sql/item_func.cc:
      Bug#8291: Illegal collation mix with USER() function.
      After discussion with PeterG and Serge, a new coercibility
      level for "system constants" was introduced, between
      COERRIBLE and IMPLICIT. Thus:
      SELECT col1 = USER() FROM t1; - is done according to col1 collation.
      SELECT 'string' = USER(); - is done according to USER() collation.
      At the same time, "nagg" and "strong" members were removed as unused.
    sql/item_strfunc.cc:
      safe_charset_converter() was added for system constants.
    sql/item_strfunc.h:
        safe_charset_converter() was added for system constants.
    mysql-test/t/func_system.test:
      New test that illegal mix of collations does not happen anymore.
    mysql-test/r/ctype_collate.result:
      fixing test results accordingly.
    mysql-test/r/func_str.result:
      fixing test results accordingly.
    mysql-test/r/func_system.result:
      fixing test results accordingly.
    mysql-test/r/type_blob.result:
      fixing test results accordingly.
    c56d0283
func_system.test 1.04 KB
#
# system functions
#

select database();
select charset(database());
select database() = "test";
select database() = _utf8"test";
select database() = _latin1"test";

select user() like "%@%";
select user() like _utf8"%@%";
select user() like _latin1"%@%";
select charset(user());

select version()>="3.23.29";
select version()>=_utf8"3.23.29";
select version()>=_latin1"3.23.29";
select charset(version());
explain extended select database(), user();

create table t1 (version char(40)) select database(), user(), version() as 'version';
show create table t1;
drop table t1;

select charset(charset(_utf8'a')), charset(collation(_utf8'a'));
select collation(charset(_utf8'a')), collation(collation(_utf8'a'));
create table t1 select charset(_utf8'a'), collation(_utf8'a');
show create table t1;
drop table t1;

select TRUE,FALSE,NULL;

#
# Bug#8291 Illegal collation mix with USER() function
#
create table t1 (a char(10)) character set latin1;
select * from t1 where a=version();
select * from t1 where a=database();
select * from t1 where a=user();
drop table t1;