diff options
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sql/table.cc b/sql/table.cc index 1764df75a7e..d07d2ca085d 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -85,7 +85,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, SQL_CRYPT *crypted=0; MEM_ROOT *old_root; DBUG_ENTER("openfrm"); - DBUG_PRINT("enter",("name: '%s' form: %lx",name,outparam)); + DBUG_PRINT("enter",("name: '%s' form: 0x%lx",name,outparam)); error=1; disk_buff=NULL; @@ -1111,6 +1111,17 @@ void append_unescaped(String *res, const char *pos, uint length) for (; pos != end ; pos++) { +#if defined(USE_MB) && MYSQL_VERSION_ID < 40100 + uint mblen; + if (use_mb(default_charset_info) && + (mblen= my_ismbchar(default_charset_info, pos, end))) + { + res->append(pos, mblen); + pos+= mblen; + continue; + } +#endif + switch (*pos) { case 0: /* Must be escaped for 'mysql' */ res->append('\\'); @@ -1537,9 +1548,7 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds) /* view fields translation table */ if (!(transl= - (Item**)(thd->current_arena ? - thd->current_arena : - thd)->alloc(select->item_list.elements * sizeof(Item*)))) + (Item**)(thd->current_arena->alloc(select->item_list.elements * sizeof(Item*))))) { DBUG_RETURN(1); } @@ -1574,6 +1583,9 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds) if (where) { Item_arena *arena= thd->current_arena, backup; + if (!arena->is_stmt_prepare()) + arena= 0; // For easier test + if (!where->fixed && where->fix_fields(thd, ancestor, &where)) goto err; |