mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
after review fix
mysql-test/r/func_str.result: new results sql/item.cc: charset changed printing string moved to String sql/item_cmpfunc.cc: new comparation class builder to avoid long switch new print_agrs used sql/item_cmpfunc.h: new comparation class builder to avoid long switch sql/item_func.cc: new print_agrs sql/item_func.h: new print_agrs sql/item_strfunc.cc: new print_agrs sql/item_subselect.cc: new comparation class builder to avoid long switch sql/item_subselect.h: new comparation class builder to avoid long switch sql/item_timefunc.cc: charset changed sql/mysql_priv.h: new comparation class builder to avoid long switch sql/mysqld.cc: new comparation class builder to avoid long switch sql/sql_parse.cc: new comparation class builder to avoid long switch sql/sql_string.cc: string printing moved to String class sql/sql_string.h: string printing moved to String class sql/sql_yacc.yy: birect class creation where it is possible
This commit is contained in:
@ -680,3 +680,35 @@ outp:
|
||||
}
|
||||
return (uint32) (to - to_start);
|
||||
}
|
||||
|
||||
void String::print(String *str)
|
||||
{
|
||||
char *st= (char*)Ptr, *end= st+str_length;
|
||||
for(; st < end; st++)
|
||||
{
|
||||
uchar c= *st;
|
||||
switch (c)
|
||||
{
|
||||
case '\\':
|
||||
str->append("\\\\", 2);
|
||||
break;
|
||||
case '\0':
|
||||
str->append("\\0", 2);
|
||||
break;
|
||||
case '\'':
|
||||
str->append("\\'", 2);
|
||||
break;
|
||||
case '\n':
|
||||
str->append("\\n", 2);
|
||||
break;
|
||||
case '\r':
|
||||
str->append("\\r", 2);
|
||||
break;
|
||||
case 26: //Ctrl-Z
|
||||
str->append("\\z", 2);
|
||||
break;
|
||||
default:
|
||||
str->append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user