diff options
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 85e578f4595..d5911e01cef 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1078,7 +1078,7 @@ String *Item_func_reverse::val_str(String *str) #ifdef USE_MB if (use_mb(res->charset())) { - register uint32 l; + uint32 l; while (ptr < end) { if ((l= my_ismbchar(res->charset(),ptr,end))) @@ -1128,7 +1128,7 @@ String *Item_func_replace::val_str_internal(String *str, bool alloced=0; #ifdef USE_MB const char *ptr,*end,*strend,*search,*search_end; - register uint32 l; + uint32 l; bool binary_cmp; #endif THD *thd= 0; @@ -1188,7 +1188,7 @@ redo: { if (*ptr == *search) { - register char *i,*j; + char *i,*j; i=(char*) ptr+1; j=(char*) search+1; while (j != search_end) if (*i++ != *j++) goto skip; @@ -1799,14 +1799,14 @@ String *Item_func_substr_index::val_str(String *str) const char *search= delimiter->ptr(); const char *search_end= search+delimiter_length; int32 n=0,c=count,pass; - register uint32 l; + uint32 l; for (pass=(count>0);pass<2;++pass) { while (ptr < end) { if (*ptr == *search) { - register char *i,*j; + char *i,*j; i=(char*) ptr+1; j=(char*) search+1; while (j != search_end) if (*i++ != *j++) goto skip; @@ -1974,7 +1974,7 @@ String *Item_func_rtrim::val_str(String *str) end= ptr+res->length(); #ifdef USE_MB char *p=ptr; - register uint32 l; + uint32 l; #endif if (remove_length == 1) { @@ -2059,7 +2059,7 @@ String *Item_func_trim::val_str(String *str) if (use_mb(collation.collation)) { char *p=ptr; - register uint32 l; + uint32 l; loop: while (ptr + remove_length < end) { @@ -4918,7 +4918,7 @@ longlong Item_dyncol_get::val_int() char *end= val.x.string.value.str + val.x.string.value.length, *org_end= end; num= my_strtoll10(val.x.string.value.str, &end, &error); - if (end != org_end || error > 0) + if (unlikely(end != org_end || error > 0)) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_BAD_DATA, @@ -5204,3 +5204,23 @@ null: my_free(names); return NULL; } + +Item_temptable_rowid::Item_temptable_rowid(TABLE *table_arg) + : Item_str_func(table_arg->in_use), table(table_arg) +{ + max_length= table->file->ref_length; +} + +void Item_temptable_rowid::fix_length_and_dec() +{ + used_tables_cache= table->map; + const_item_cache= false; +} + +String *Item_temptable_rowid::val_str(String *str) +{ + if (!((null_value= table->null_row))) + table->file->position(table->record[0]); + str_value.set((char*)(table->file->ref), max_length, &my_charset_bin); + return &str_value; +} |