summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-13 02:18:39 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-13 02:18:39 +0300
commit51156c5af2a8a3a978085a7c54de0ad55f73775c (patch)
tree05ad0900ffa45f9028b912889f27021e3e9cb962 /sql/ha_innodb.cc
parent689a43874659ca5714edcd5effd3dcef2e3930cb (diff)
downloadmariadb-git-51156c5af2a8a3a978085a7c54de0ad55f73775c.tar.gz
Changed SQL variable delay_key_write to an enum
able delay_key_write as default (as it was in 4.0.2) Docs/manual.texi: Updated information about variable DELAY_KEY_WRITE. mysql-test/r/type_decimal.result: Updated results mysql-test/r/variables.result: Updated results mysql-test/t/type_decimal.test: Fixed test to not cause purify error in mathlib during purify. mysql-test/t/variables.test: Test new usage of DELAY_KEY_WRITE sql/ha_innodb.cc: Merge with 3.23 code sql/mysql_priv.h: Changed SQL variable delay_key_write to an enum sql/mysqld.cc: Changed SQL variable delay_key_write to an enum. Enable delay_key_write as default (as it was in 4.0.2) sql/set_var.cc: Changed SQL variable delay_key_write to an enum sql/set_var.h: Changed SQL variable delay_key_write to an enum sql/sql_class.h: Changed SQL variable delay_key_write to an enum sql/sql_yacc.yy: Changed SQL variable delay_key_write to an enum
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc69
1 files changed, 39 insertions, 30 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 97dc26df184..eaf09325124 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -265,51 +265,60 @@ the prototype for this function! */
void
innobase_mysql_print_thd(
/*=====================*/
- char* buf, /* in/out: buffer where to print, must be at least
- 300 bytes */
- void* input_thd)/* in: pointer to a MySQL THD object */
+ char* buf, /* in/out: buffer where to print, must be at least
+ 400 bytes */
+ void* input_thd)/* in: pointer to a MySQL THD object */
{
- THD* thd;
+ THD* thd;
+ char* old_buf = buf;
- thd = (THD*) input_thd;
+ thd = (THD*) input_thd;
- /* We can't use value of sprintf() as this is not portable */
- buf+= my_sprintf(buf,
+ /* We cannot use the return value of normal sprintf() as this is
+ not portable to some old non-Posix Unixes, e.g., some old SCO
+ Unixes */
+
+ buf += my_sprintf(buf,
(buf, "MySQL thread id %lu, query id %lu",
thd->thread_id, thd->query_id));
- if (thd->host)
- {
- *buf++=' ';
- buf=strnmov(buf, thd->host, 30);
+ if (thd->host) {
+ *buf = ' ';
+ buf++;
+ buf = strnmov(buf, thd->host, 30);
}
- if (thd->ip)
- {
- *buf++=' ';
- buf=strnmov(buf, thd->ip, 20);
+ if (thd->ip) {
+ *buf = ' ';
+ buf++;
+ buf=strnmov(buf, thd->ip, 20);
}
- if (thd->user)
- {
- *buf++=' ';
- buf=strnmov(buf, thd->user, 20);
+ if (thd->user) {
+ *buf = ' ';
+ buf++;
+ buf=strnmov(buf, thd->user, 20);
}
- if (thd->proc_info)
- {
- *buf++=' ';
- buf=strnmov(buf, thd->proc_info, 50);
+ if (thd->proc_info) {
+ *buf = ' ';
+ buf++;
+ buf=strnmov(buf, thd->proc_info, 50);
}
- if (thd->query)
- {
- *buf++=' ';
- buf=strnmov(buf, thd->query, 150);
+ if (thd->query) {
+ *buf = '\n';
+ buf++;
+ buf=strnmov(buf, thd->query, 150);
}
- buf[0]='\n';
- buf[1]=0;
- ut_a(strlen(buf) < 400);
+ buf[0] = '\n';
+ buf[1] = '\0'; /* Note that we must put a null character here to end
+ the printed string */
+
+ /* We test the printed length did not overrun the buffer length of
+ 400 bytes */
+
+ ut_a(strlen(old_buf) < 400);
}
}