diff options
author | unknown <monty@donna.mysql.fi> | 2001-04-25 01:11:29 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.fi> | 2001-04-25 01:11:29 +0300 |
commit | dbd56fcdc575d522e8cac6046b85e29d496a37e9 (patch) | |
tree | b35002c3218b71a338dff899023d7799c6cc4829 /client/mysql.cc | |
parent | 7337a193b1bb590c127daa9d92839e476e9b219f (diff) | |
download | mariadb-git-dbd56fcdc575d522e8cac6046b85e29d496a37e9.tar.gz |
Fixes for embedded MySQL
Some limit optimization
BitKeeper/deleted/.del-ib_config.h.in~9e57db8504e55b7:
Delete: innobase/ib_config.h.in
BitKeeper/deleted/.del-ib_config.h~7539e26ffc614439:
Delete: innobase/ib_config.h
client/errmsg.c:
Moved error messages from libmysqld/
client/mysql.cc:
Removed warnings
include/errmsg.h:
New info for embedded versions
include/mysql_com.h:
Fixes for embedded MySQL
libmysql/errmsg.c:
Fixes for embedded MySQL
libmysqld/Makefile.am:
Added HANDLER code
libmysqld/lib_sql.cc:
Fixes for embedded MySQL
libmysqld/lib_vio.c:
Fixes for embedded MySQL
BitKeeper/etc/ignore:
Added libmysqld/sql_handler.cc to the ignore list
libmysqld/libmysqld.c:
Fixes for embedded MySQL
mysql-test/r/null_key.result:
Fixed result for 4.0
sql/net_serv.cc:
Fixes for embedded MySQL
sql/sql_parse.cc:
Fixes for embedded MySQL where the query could be a const char*
sql/sql_select.cc:
Added limit optimization
sql/sql_select.h:
Added limit optimization
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 1c8e8485c01..ce51467ffd9 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -133,7 +133,7 @@ static String glob_buffer,old_buffer; static int wait_time = 5; static STATUS status; static ulong select_limit,max_join_size,opt_connect_timeout=0; -static char *xmlmeta[] = { +static const char *xmlmeta[] = { "&", "&", "<", "<", 0, 0 @@ -173,8 +173,8 @@ static int sql_connect(char *host,char *database,char *user,char *password, uint silent); static int put_info(const char *str,INFO_TYPE info,uint error=0); static void safe_put_field(const char *pos,ulong length); -static char *array_value(char **array, char *key); -static char *xmlencode(char *dest, char *src); +static const char *array_value(const char **array, char *key); +static void xmlencode(char *dest, char *src); static void my_chomp(char *end); static void init_pager(); static void end_pager(); @@ -1739,8 +1739,8 @@ print_table_data_vertically(MYSQL_RES *result) } } -static char -*array_value(char **array, char *key) { +static const char +*array_value(const char **array, char *key) { int x; for(x=0; array[x]; x+=2) if(!strcmp(array[x], key)) @@ -1748,19 +1748,21 @@ static char return 0; } -static char -*xmlencode(char *dest, char *src) { +static void +xmlencode(char *dest, char *src) +{ char *p = src; - char *t; + const char *t; char s[2] = { 0, 0 }; *dest = 0; - do { + do + { s[0] = *p; - if(!(t=array_value(xmlmeta, s))) t = s; - strcat(dest, t); + if (!(t=array_value(xmlmeta, s))) + t = s; + dest=strmov(dest, t); } while(*p++); - return dest; } static void |