summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <gluh@eagle.(none)>2007-10-11 16:13:14 +0500
committerunknown <gluh@eagle.(none)>2007-10-11 16:13:14 +0500
commit937504e7a04fde9c776f0ce06c7c5c03da5f1905 (patch)
treeceb4905902b6a1c3130c1349e1eadc3c4b2a3092 /sql/sql_yacc.yy
parentcbe03180802538699441efc97e04902289dbca1c (diff)
parentf30eacb223f581ece4bce02b3c4dfac1310f9f72 (diff)
downloadmariadb-git-937504e7a04fde9c776f0ce06c7c5c03da5f1905.tar.gz
Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/ctype_utf8.test: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/sql_yacc.yy: manual merge
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy27
1 files changed, 20 insertions, 7 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 68680addc58..44667a425fe 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -9931,11 +9931,19 @@ literal:
String *str= tmp ?
tmp->quick_fix_field(), tmp->val_str((String*) 0) :
(String*) 0;
- $$= new Item_string(str ? str->ptr() : "",
+ $$= new Item_string(NULL, /* name will be set in select_item */
+ str ? str->ptr() : "",
str ? str->length() : 0,
$1);
if ($$)
+ {
((Item_string *) $$)->set_repertoire_from_value();
+ if (!$$->check_well_formed_result(&$$->str_value))
+ {
+ $$= new Item_null();
+ $$->set_name(NULL, 0, system_charset_info);
+ }
+ }
}
| UNDERSCORE_CHARSET BIN_NUM
{
@@ -9947,14 +9955,19 @@ literal:
String *str= tmp ?
tmp->quick_fix_field(), tmp->val_str((String*) 0) :
(String*) 0;
- $$= new Item_string(str ? str->ptr() : "",
+ $$= new Item_string(NULL, /* name will be set in select_item */
+ str ? str->ptr() : "",
str ? str->length() : 0,
- Lex->charset);
+ Lex->underscore_charset);
+ if ($$ && !$$->check_well_formed_result(&$$->str_value))
+ {
+ $$= new Item_null();
+ $$->set_name(NULL, 0, system_charset_info);
+ }
}
- | DATE_SYM text_literal { $$ = $2; }
- | TIME_SYM text_literal { $$ = $2; }
- | TIMESTAMP text_literal { $$ = $2; }
- ;
+ | DATE_SYM text_literal { $$ = $2; }
+ | TIME_SYM text_literal { $$ = $2; }
+ | TIMESTAMP text_literal { $$ = $2; };
NUM_literal:
NUM