From bc6652db9b1f5f302648c3a920fb1fa25449a6d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2004 18:44:51 +0300 Subject: Fix compiler warnings (detected by Intel's C++ compiler) Fixed checking of privilege handling in CREATE ... SELECT (Bug #6094) client/mysql.cc: Fix compiler warnings client/mysqltest.c: Fix wrong counting of lines Remove compiler warnings heap/hp_hash.c: Fix compiler warnings innobase/dict/dict0load.c: Fix compiler warnings innobase/include/mem0mem.h: Fix compiler warnings libmysql/client_settings.h: Fix compiler warnings myisam/ft_nlq_search.c: Add comments about compiler warnings myisam/rt_index.c: Add comments about compiler warnings myisam/rt_mbr.c: Add comments about compiler warnings mysql-test/r/ps.result: Test case for bug#6094 mysql-test/t/ps.test: Test case for bug#6094 mysys/hash.c: Fix compiler warnings mysys/my_handler.c: Add comments about compiler warnings mysys/my_thr_init.c: Add comments about compiler warnings ndb/include/mgmapi/mgmapi.h: Fix compiler warnings regex/main.c: Fix compiler warnings sql/item.h: Fix compiler warnings sql/item_func.h: Add comments about compiler warnings sql/spatial.h: Add comments about compiler warnings sql/sql_lex.h: Fix compiler warning sql/sql_list.h: Fix compiler warning sql/sql_parse.cc: Move testing of access rights of tables in CREATE ... SELECT to create_table_precheck() to fix privilege checking in CREATE ... SELECT (Bug #6094) sql/sql_prepare.cc: Remove not needed empty line sql/sql_string.h: Fix compiler warnings strings/ctype-mb.c: Fix compiler warnings --- client/mysql.cc | 5 +++-- client/mysqltest.c | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'client') diff --git a/client/mysql.cc b/client/mysql.cc index 05d5d1355ad..358b13e652b 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1971,7 +1971,7 @@ print_field_types(MYSQL_RES *result) MYSQL_FIELD *field; while ((field = mysql_fetch_field(result))) { - tee_fprintf(PAGER,"Catalog: '%s'\nDatabase: '%s'\nTable: '%s'\nName: '%s'\nType: %d\nLength: %d\nMax length: %d\nIs_null: %d\nFlags: %d\nDecimals: %d\n\n", + tee_fprintf(PAGER,"Catalog: '%s'\nDatabase: '%s'\nTable: '%s'\nName: '%s'\nType: %d\nLength: %ld\nMax length: %ld\nIs_null: %d\nFlags: %u\nDecimals: %u\n\n", field->catalog, field->db, field->table, field->name, (int) field->type, field->length, field->max_length, @@ -2017,7 +2017,8 @@ print_table_data(MYSQL_RES *result) (void) tee_fputs("|", PAGER); for (uint off=0; (field = mysql_fetch_field(result)) ; off++) { - tee_fprintf(PAGER, " %-*s|",min(field->max_length,MAX_COLUMN_LENGTH), + tee_fprintf(PAGER, " %-*s|",(int) min(field->max_length, + MAX_COLUMN_LENGTH), field->name); num_flag[off]= IS_NUM(field->type); } diff --git a/client/mysqltest.c b/client/mysqltest.c index 7be65941f2d..6226189cbbb 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -359,8 +359,7 @@ DYNAMIC_STRING ds_res; static void die(const char *fmt, ...); static void init_var_hash(); static VAR* var_from_env(const char *, const char *); -static byte* get_var_key(const byte* rec, uint* len, - my_bool __attribute__((unused)) t); +static byte* get_var_key(const byte* rec, uint* len, my_bool t); static VAR* var_init(VAR* v, const char *name, int name_len, const char *val, int val_len); @@ -1785,6 +1784,10 @@ int read_line(char* buf, int size) continue; } + /* Line counting is independent of state */ + if (c == '\n') + (*lineno)++; + switch(state) { case R_NORMAL: /* Only accept '{' in the beginning of a line */ @@ -1800,14 +1803,12 @@ int read_line(char* buf, int size) else if (c == '\n') { state = R_LINE_START; - (*lineno)++; } break; case R_COMMENT: if (c == '\n') { *p= 0; - (*lineno)++; DBUG_RETURN(0); } break; @@ -1819,7 +1820,7 @@ int read_line(char* buf, int size) else if (my_isspace(charset_info, c)) { if (c == '\n') - start_lineno= ++*lineno; /* Query hasn't started yet */ + start_lineno= *lineno; /* Query hasn't started yet */ no_save= 1; } else if (c == '}') -- cgit v1.2.1