From 30c4d10e1a173e9b3cd5d14f81a140bb6ed5115e Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Thu, 13 Jan 2005 02:13:19 +0300 Subject: Add logging of COM_EXECUTE in the general query log. --- sql/sql_parse.cc | 2 +- sql/sql_prepare.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2b273f4b84c..4d802ad4f34 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -64,7 +64,7 @@ const char *command_name[]={ "Drop DB", "Refresh", "Shutdown", "Statistics", "Processlist", "Connect","Kill","Debug","Ping","Time","Delayed insert","Change user", "Binlog Dump","Table Dump", "Connect Out", "Register Slave", - "Prepare", "Prepare Execute", "Long Data", "Close stmt", + "Prepare", "Execute", "Long Data", "Close stmt", "Reset stmt", "Set option", "Error" // Last command number }; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 20ebc23e240..ecf01824755 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1592,7 +1592,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, DBUG_RETURN(1); } - mysql_log.write(thd, COM_PREPARE, "%s", packet); + mysql_log.write(thd, COM_PREPARE, "[%lu] %s", stmt->id, packet); thd->current_arena= stmt; mysql_init_query(thd, (uchar *) thd->query, thd->query_length); @@ -1792,6 +1792,9 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) if (stmt->param_count && stmt->set_params_data(stmt, &expanded_query)) goto set_params_data_err; #endif + mysql_log.write(thd, COM_EXECUTE, "[%lu] %s", stmt->id, + expanded_query.length() ? expanded_query.c_ptr() : + stmt->query); thd->protocol= &thd->protocol_prep; // Switch to binary protocol execute_stmt(thd, stmt, &expanded_query, TRUE); thd->protocol= &thd->protocol_simple; // Use normal protocol -- cgit v1.2.1 From e3d6e6736b78c98d31a7c214556c133ec20fd5df Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 13 Jan 2005 18:12:04 +0400 Subject: bug#7284: strnxfrm returns different results for equal strings --- sql/field.cc | 12 +++--------- sql/filesort.cc | 5 +---- 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'sql') diff --git a/sql/field.cc b/sql/field.cc index e2c11cc7372..86073072a64 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4393,8 +4393,7 @@ void Field_string::sort_string(char *to,uint length) uint tmp=my_strnxfrm(field_charset, (unsigned char *) to, length, (unsigned char *) ptr, field_length); - if (tmp < length) - field_charset->cset->fill(field_charset, to + tmp, length - tmp, ' '); + DBUG_ASSERT(tmp == length); } @@ -4596,9 +4595,7 @@ void Field_varstring::sort_string(char *to,uint length) (uchar*) to, length, (uchar*) ptr+HA_KEY_BLOB_LENGTH, tot_length); - if (tot_length < length) - field_charset->cset->fill(field_charset, to+tot_length,length-tot_length, - binary() ? (char) 0 : ' '); + DBUG_ASSERT(tot_length == length); } @@ -5116,10 +5113,7 @@ void Field_blob::sort_string(char *to,uint length) blob_length=my_strnxfrm(field_charset, (uchar*) to, length, (uchar*) blob, blob_length); - if (blob_length < length) - field_charset->cset->fill(field_charset, to+blob_length, - length-blob_length, - binary() ? (char) 0 : ' '); + DBUG_ASSERT(blob_length == length); } } diff --git a/sql/filesort.cc b/sql/filesort.cc index bd0de022fd4..cb377070aaa 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -622,10 +622,7 @@ static void make_sortkey(register SORTPARAM *param, } uint tmp_length=my_strnxfrm(cs,to,sort_field->length, (unsigned char *) from, length); - if (tmp_length < sort_field->length) - cs->cset->fill(cs, (char*) to+tmp_length, - sort_field->length-tmp_length, - fill_char); + DBUG_ASSERT(tmp_length == sort_field->length); } else { -- cgit v1.2.1