diff options
author | unknown <msvensson@shellback.(none)> | 2006-10-12 20:15:56 +0200 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2006-10-12 20:15:56 +0200 |
commit | 23e941505592fa7f282f47d12e89e63ef236f2ca (patch) | |
tree | 3eabd140b981cc0927eec091e64921a0899e4c4d | |
parent | f371303eaf83f4ac3935f07f136d2b54cdecbf0a (diff) | |
download | mariadb-git-23e941505592fa7f282f47d12e89e63ef236f2ca.tar.gz |
Add ATTRIBUTE_FORMAT specifier to _db_doprnt, which is used by DBUG_PRINT
This will hopefully avoiid annoying crashes when running with --debug
Fix warnings from the above in mysqltest.c
client/mysqltest.c:
Fix format specifier warnings in mysqltest.c
include/my_dbug.h:
Add ATTRIBUTE_FORMAT specifier to _db_doprnt, which is used by DBUG_PRINT
This will hopefully avoiid annoying crashes when running with --debug
-rw-r--r-- | client/mysqltest.c | 8 | ||||
-rw-r--r-- | include/my_dbug.h | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index e2317560404..4aa30ba3f1e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -890,7 +890,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname) die(NullS); if (!eval_result && (uint) stat_info.st_size != ds->length) { - DBUG_PRINT("info",("Size differs: result size: %u file size: %u", + DBUG_PRINT("info",("Size differs: result size: %u file size: %llu", ds->length, stat_info.st_size)); DBUG_PRINT("info",("result: '%s'", ds->str)); DBUG_RETURN(RESULT_LENGTH_MISMATCH); @@ -2558,7 +2558,7 @@ void do_get_errcodes(struct st_command *command) *to_ptr= 0; to->type= ERR_SQLSTATE; - DBUG_PRINT("info", ("ERR_SQLSTATE: %d", to->code.sqlstate)); + DBUG_PRINT("info", ("ERR_SQLSTATE: %s", to->code.sqlstate)); } else if (*p == 's') { @@ -4317,7 +4317,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt, bind[i].is_null= &is_null[i]; bind[i].length= &length[i]; - DBUG_PRINT("bind", ("col[%d]: buffer_type: %d, buffer_length: %d", + DBUG_PRINT("bind", ("col[%d]: buffer_type: %d, buffer_length: %lu", i, bind[i].buffer_type, bind[i].buffer_length)); } @@ -7267,5 +7267,3 @@ void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val) char *end= longlong10_to_str(val, buff, 10); replace_dynstr_append_mem(ds, buff, end - buff); } - - diff --git a/include/my_dbug.h b/include/my_dbug.h index 711ece4335c..d2f6e40f3c6 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -35,7 +35,8 @@ extern void _db_enter_(const char *_func_,const char *_file_,uint _line_, extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_, uint *_slevel_); extern void _db_pargs_(uint _line_,const char *keyword); -extern void _db_doprnt_ _VARARGS((const char *format,...)); +extern void _db_doprnt_ _VARARGS((const char *format,...)) + ATTRIBUTE_FORMAT(printf, 1, 2); extern void _db_dump_(uint _line_,const char *keyword,const char *memory, uint length); extern void _db_output_(); |