summaryrefslogtreecommitdiff
path: root/sql/sql_string.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-11-03 12:28:36 +0200
committerunknown <bell@sanja.is.com.ua>2003-11-03 12:28:36 +0200
commitef163ff0fc200c8c647b48e1390d187ebffed2ba (patch)
tree9fcd3368f411e3ebf81bd5b0e3aa64c0f430970f /sql/sql_string.cc
parent22c9da4dee3f5c7b1f780aa47f1a361191e51487 (diff)
downloadmariadb-git-ef163ff0fc200c8c647b48e1390d187ebffed2ba.tar.gz
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
Diffstat (limited to 'sql/sql_string.cc')
-rw-r--r--sql/sql_string.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index be9404ce0b8..61070f07266 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -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);
+ }
+ }
+}