summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-03-18 15:14:36 +0200
committerunknown <bell@sanja.is.com.ua>2004-03-18 15:14:36 +0200
commit1a81e0414515cef6275b5d2f3f27b950aa1ff91f (patch)
treecd9a05b7a39b8aa75fa136b3e98ef798762bbcb8 /sql/sql_yacc.yy
parentf83cf4144065c12cad4007767e2e70d444fd0e05 (diff)
downloadmariadb-git-1a81e0414515cef6275b5d2f3f27b950aa1ff91f.tar.gz
DBUG_ASSERT(fixed == 1); added to val*
small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy27
1 files changed, 24 insertions, 3 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index dc7d3d55110..48ac364087b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4342,6 +4342,11 @@ purge_option:
YYABORT;
}
Item *tmp= new Item_func_unix_timestamp($2);
+ /*
+ it is OK olny emulate fix_fieds, because we need only
+ value of constant
+ */
+ tmp->Item::fix_fields(0,0,0);
Lex->sql_command = SQLCOM_PURGE_BEFORE;
Lex->purge_time= (ulong) tmp->val_int();
}
@@ -4476,7 +4481,13 @@ text_string:
| HEX_NUM
{
Item *tmp = new Item_varbinary($1.str,$1.length);
- $$= tmp ? tmp->val_str((String*) 0) : (String*) 0;
+ /*
+ it is OK olny emulate fix_fieds, because we need only
+ value of constant
+ */
+ $$= tmp ?
+ tmp->Item::fix_fields(0,0,0), tmp->val_str((String*) 0) :
+ (String*) 0;
}
;
@@ -4506,7 +4517,11 @@ param_marker:
signed_literal:
literal { $$ = $1; }
| '+' NUM_literal { $$ = $2; }
- | '-' NUM_literal { $$ = new Item_func_neg($2); }
+ | '-' NUM_literal
+ {
+ /* $2 it's Item_int -> we can get value without fix_fields call */
+ $$= new Item_int(-$2->val_int(), $2->max_length+1);
+ }
;
@@ -4519,7 +4534,13 @@ literal:
| UNDERSCORE_CHARSET HEX_NUM
{
Item *tmp= new Item_varbinary($2.str,$2.length);
- String *str= tmp ? tmp->val_str((String*) 0) : (String*) 0;
+ /*
+ it is OK olny emulate fix_fieds, because we need only
+ value of constant
+ */
+ String *str= tmp ?
+ tmp->Item::fix_fields(0,0,0), tmp->val_str((String*) 0) :
+ (String*) 0;
$$= new Item_string(str ? str->ptr() : "",
str ? str->length() : 0,
Lex->charset);