Commit ea16aad2 authored by unknown's avatar unknown

disabled query cache in mysqldump queries


Docs/manual.texi:
  disabled query cache note added to changelog
client/mysqldump.c:
  query cache disabled by adding SQL_NO_CACHE;
  buffer for select query command incresed on 512 byte; 
  query command buffer size defined as marco QUERY_LENGTH.
parent 63686ef5
...@@ -48956,6 +48956,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. ...@@ -48956,6 +48956,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet @itemize @bullet
@item @item
Query cache disabled in mysqldump.
@item
Boolean fulltext search weighting scheme changed to something more reasonable. Boolean fulltext search weighting scheme changed to something more reasonable.
@item @item
Fixed bug in boolean fulltext search, that caused MySQL to ignore queries of Fixed bug in boolean fulltext search, that caused MySQL to ignore queries of
...@@ -64,6 +64,9 @@ ...@@ -64,6 +64,9 @@
#define SHOW_EXTRA 5 #define SHOW_EXTRA 5
#define QUOTE_CHAR '`' #define QUOTE_CHAR '`'
/* Size of buffer for dump's select query */
#define QUERY_LENGTH 1536
static char *add_load_option(char *ptr, const char *object, static char *add_load_option(char *ptr, const char *object,
const char *statement); const char *statement);
...@@ -909,7 +912,7 @@ static char *field_escape(char *to,const char *from,uint length) ...@@ -909,7 +912,7 @@ static char *field_escape(char *to,const char *from,uint length)
*/ */
static void dumpTable(uint numFields, char *table) static void dumpTable(uint numFields, char *table)
{ {
char query[1024], *end, buff[256],table_buff[NAME_LEN+3]; char query[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3];
MYSQL_RES *res; MYSQL_RES *res;
MYSQL_FIELD *field; MYSQL_FIELD *field;
MYSQL_ROW row; MYSQL_ROW row;
...@@ -926,7 +929,8 @@ static void dumpTable(uint numFields, char *table) ...@@ -926,7 +929,8 @@ static void dumpTable(uint numFields, char *table)
my_delete(filename, MYF(0)); /* 'INTO OUTFILE' doesn't work, if my_delete(filename, MYF(0)); /* 'INTO OUTFILE' doesn't work, if
filename wasn't deleted */ filename wasn't deleted */
to_unix_path(filename); to_unix_path(filename);
sprintf(query, "SELECT * INTO OUTFILE '%s'", filename); sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * INTO OUTFILE '%s'",
filename);
end= strend(query); end= strend(query);
if (replace) if (replace)
end= strmov(end, " REPLACE"); end= strmov(end, " REPLACE");
...@@ -957,7 +961,8 @@ static void dumpTable(uint numFields, char *table) ...@@ -957,7 +961,8 @@ static void dumpTable(uint numFields, char *table)
if (!opt_xml) if (!opt_xml)
fprintf(md_result_file,"\n--\n-- Dumping data for table '%s'\n--\n", fprintf(md_result_file,"\n--\n-- Dumping data for table '%s'\n--\n",
table); table);
sprintf(query, "SELECT * FROM %s", quote_name(table,table_buff)); sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * FROM %s",
quote_name(table,table_buff));
if (where) if (where)
{ {
if (!opt_xml) if (!opt_xml)
...@@ -1420,8 +1425,6 @@ int main(int argc, char **argv) ...@@ -1420,8 +1425,6 @@ int main(int argc, char **argv)
return(first_error); return(first_error);
} }
} }
if(mysql_query(sock, "SET SQL_QUERY_CACHE_TYPE=OFF") && verbose)
fprintf(stderr, "-- Can't disable query cache (not supported).\n");
if (opt_alldbs) if (opt_alldbs)
dump_all_databases(); dump_all_databases();
/* Only one database and selected table(s) */ /* Only one database and selected table(s) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment