diff options
author | monty@mysql.com <> | 2004-03-18 00:09:13 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2004-03-18 00:09:13 +0200 |
commit | f34a642d6e492fa527e09593aa695e67d3867263 (patch) | |
tree | 93869dd2e083920baaab586bbd65e0b77b42fcfa /sql | |
parent | f9ad65049088dc58591c954903a22e527e96ea5a (diff) | |
download | mariadb-git-f34a642d6e492fa527e09593aa695e67d3867263.tar.gz |
after merge fixes
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field.cc | 36 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 6 |
3 files changed, 22 insertions, 22 deletions
diff --git a/sql/field.cc b/sql/field.cc index c4aef133e6d..3355c45519e 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2264,25 +2264,23 @@ void Field_longlong::sql_type(String &res) const add_zerofill_and_unsigned(res); } + /**************************************************************************** -** single precision float + single precision float ****************************************************************************/ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs) { - int err; + int error; char *end; - double nr= my_strntod(cs,(char*) from,len,&end,&err); - if (!err && (!current_thd->count_cuted_fields || end-from==len)) - { - return Field_float::store(nr); - } - else + double nr= my_strntod(cs,(char*) from,len,&end,&error); + if (error || ((uint) (end-from) != len && current_thd->count_cuted_fields)) { + error= 1; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); - Field_float::store(nr); - return 1; } + Field_float::store(nr); + return error; } @@ -2562,25 +2560,23 @@ void Field_float::sql_type(String &res) const add_zerofill_and_unsigned(res); } + /**************************************************************************** -** double precision floating point numbers + double precision floating point numbers ****************************************************************************/ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs) { - int err; + int error; char *end; - double nr= my_strntod(cs,(char*) from,len,&end,&err); - if (!err && (!current_thd->count_cuted_fields || end-from==len)) - { - return Field_double::store(nr); - } - else + double nr= my_strntod(cs,(char*) from, len, &end, &error); + if (error || ((uint) (end-from) != len && current_thd->count_cuted_fields)) { + error= 1; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); - Field_double::store(nr); - return 1; } + Field_double::store(nr); + return error; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6eed4298460..0e2db1f5b17 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1427,10 +1427,10 @@ int open_tables(THD *thd, TABLE_LIST *start, uint *counter) bool refresh; int result=0; DBUG_ENTER("open_tables"); - *counter= 0; thd->current_tablenr= 0; restart: + *counter= 0; thd->proc_info="Opening tables"; for (tables=start ; tables ; tables=tables->next) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 690b4133f61..51600f712e9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -117,6 +117,7 @@ static bool end_active_trans(THD *thd) } +#ifdef HAVE_REPLICATION inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables) { return (table_rules_on && tables && !tables_ok(thd,tables) && @@ -124,6 +125,7 @@ inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables) !tables_ok(thd, (TABLE_LIST *)thd->lex->auxilliary_table_list.first))); } +#endif static HASH hash_user_connections; @@ -3961,6 +3963,8 @@ void mysql_parse(THD *thd, char *inBuf, uint length) DBUG_VOID_RETURN; } + +#ifdef HAVE_REPLICATION /* Usable by the replication SQL thread only: just parse a query to know if it can be ignored because of replicate-*-table rules. @@ -3985,7 +3989,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) return error; } - +#endif /***************************************************************************** ** Store field definition for create |