From 9417dc5c17bc0c35d04e20e600ce7804ec20e736 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2001 23:20:19 +0300 Subject: Portability fixes + a couple of bug fixes introduced by last push. Docs/manual.texi: Removed wrong web links include/mysql_com.h: Portability fix libmysqld/Makefile.am: Fix 'make dist' mysys/mf_dirname.c: Bugfix for last push scripts/explain_log.sh: Nicer output scripts/mysql_install_db.sh: Removed warnings when using 'mysql_install_db' sql/sql_parse.cc: Ensure that thd->query_length is always set sql/sql_show.cc: cleanup sql/sql_yacc.yy: Fix bug in last push vio/vio.c: Merge with violite.cc vio/viosocket.c: Merge with violite.cc --- sql/sql_parse.cc | 21 +++++++++++---------- sql/sql_show.cc | 7 +++---- sql/sql_yacc.yy | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'sql') diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 35f32d50f46..cdf6cb8e7f1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -633,6 +633,7 @@ pthread_handler_decl(handle_bootstrap,arg) length--; buff[length]=0; thd->current_tablenr=0; + thd->query_length=length; thd->query= thd->memdup(buff,length+1); thd->query_id=query_id++; mysql_parse(thd,thd->query,length); @@ -692,19 +693,18 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd) thd->free_list = 0; thd->query = tbl_name; - if((error = mysqld_dump_create_info(thd, table, -1))) - { - my_error(ER_GET_ERRNO, MYF(0)); - goto err; - } + thd->query_length=strlen(tbl_name); + if ((error = mysqld_dump_create_info(thd, table, -1))) + { + my_error(ER_GET_ERRNO, MYF(0)); + goto err; + } net_flush(&thd->net); if ((error = table->file->dump(thd,fd))) my_error(ER_GET_ERRNO, MYF(0)); err: - close_thread_tables(thd); - DBUG_RETURN(error); } @@ -872,6 +872,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->free_list=0; table_list.name=table_list.real_name=thd->strdup(packet); thd->query=fields=thd->strdup(strend(packet)+1); + thd->query_length=strlen(thd->query); mysql_log.write(thd,command,"%s %s",table_list.real_name,fields); remove_escape(table_list.real_name); // This can't have wildcards @@ -2052,9 +2053,9 @@ mysql_execute_command(void) goto error; res = mysql_table_grant(thd,tables,lex->users_list, lex->columns, lex->grant, lex->sql_command == SQLCOM_REVOKE); - if(!res) + if (!res) { - mysql_update_log.write(thd, thd->query,thd->query_length); + mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query); @@ -2074,7 +2075,7 @@ mysql_execute_command(void) lex->sql_command == SQLCOM_REVOKE); if (!res) { - mysql_update_log.write(thd, thd->query,thd->query_length); + mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 438d6b7eed6..5a9777e24a4 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -759,17 +759,16 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd) convert->convert((char*) packet->ptr(), packet->length()); if (fd < 0) { - if(my_net_write(&thd->net, (char*)packet->ptr(), packet->length())) + if (my_net_write(&thd->net, (char*)packet->ptr(), packet->length())) DBUG_RETURN(-1); VOID(net_flush(&thd->net)); } else { - if(my_write(fd, (const byte*) packet->ptr(), packet->length(), - MYF(MY_WME))) + if (my_write(fd, (const byte*) packet->ptr(), packet->length(), + MYF(MY_WME))) DBUG_RETURN(-1); } - DBUG_RETURN(0); } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 8a4c219adb0..7d084f5878e 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3335,7 +3335,7 @@ require_list_element: SUBJECT_SYM TEXT_STRING } | CIPHER_SYM TEXT_STRING { - LEX *lex=lex; + LEX *lex=Lex; if (lex->ssl_cipher) { net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "CHIPER"); -- cgit v1.2.1