Loading mysql-test/r/user_var.result +7 −0 Original line number Diff line number Diff line Loading @@ -204,3 +204,10 @@ set @var= NULL ; select FIELD( @var,'1it','Hit') as my_column; my_column 0 select @v, coercibility(@v); @v coercibility(@v) NULL 2 set @v1=null, @v2=1, @v3=1.1, @v4=now(); select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4); coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4) 2 2 2 2 mysql-test/t/user_var.test +7 −0 Original line number Diff line number Diff line Loading @@ -124,3 +124,10 @@ drop table t1; # set @var= NULL ; select FIELD( @var,'1it','Hit') as my_column; # # Bug#9425 A user variable doesn't always have implicit coercibility # select @v, coercibility(@v); set @v1=null, @v2=1, @v3=1.1, @v4=now(); select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4); sql/item_func.cc +6 −3 Original line number Diff line number Diff line Loading @@ -3569,20 +3569,20 @@ Item_func_set_user_var::update() case REAL_RESULT: { res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal), REAL_RESULT, &my_charset_bin, DERIVATION_NONE); REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT); break; } case INT_RESULT: { res= update_hash((void*) &save_result.vint, sizeof(save_result.vint), INT_RESULT, &my_charset_bin, DERIVATION_NONE); INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT); break; } case STRING_RESULT: { if (!save_result.vstr) // Null value res= update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin, DERIVATION_NONE); DERIVATION_IMPLICIT); else res= update_hash((void*) save_result.vstr->ptr(), save_result.vstr->length(), STRING_RESULT, Loading Loading @@ -3850,7 +3850,10 @@ void Item_func_get_user_var::fix_length_and_dec() } } else { collation.set(&my_charset_bin, DERIVATION_IMPLICIT); null_value= 1; } if (error) thd->fatal_error(); Loading Loading
mysql-test/r/user_var.result +7 −0 Original line number Diff line number Diff line Loading @@ -204,3 +204,10 @@ set @var= NULL ; select FIELD( @var,'1it','Hit') as my_column; my_column 0 select @v, coercibility(@v); @v coercibility(@v) NULL 2 set @v1=null, @v2=1, @v3=1.1, @v4=now(); select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4); coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4) 2 2 2 2
mysql-test/t/user_var.test +7 −0 Original line number Diff line number Diff line Loading @@ -124,3 +124,10 @@ drop table t1; # set @var= NULL ; select FIELD( @var,'1it','Hit') as my_column; # # Bug#9425 A user variable doesn't always have implicit coercibility # select @v, coercibility(@v); set @v1=null, @v2=1, @v3=1.1, @v4=now(); select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
sql/item_func.cc +6 −3 Original line number Diff line number Diff line Loading @@ -3569,20 +3569,20 @@ Item_func_set_user_var::update() case REAL_RESULT: { res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal), REAL_RESULT, &my_charset_bin, DERIVATION_NONE); REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT); break; } case INT_RESULT: { res= update_hash((void*) &save_result.vint, sizeof(save_result.vint), INT_RESULT, &my_charset_bin, DERIVATION_NONE); INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT); break; } case STRING_RESULT: { if (!save_result.vstr) // Null value res= update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin, DERIVATION_NONE); DERIVATION_IMPLICIT); else res= update_hash((void*) save_result.vstr->ptr(), save_result.vstr->length(), STRING_RESULT, Loading Loading @@ -3850,7 +3850,10 @@ void Item_func_get_user_var::fix_length_and_dec() } } else { collation.set(&my_charset_bin, DERIVATION_IMPLICIT); null_value= 1; } if (error) thd->fatal_error(); Loading