diff options
author | unknown <monty@mysql.com> | 2004-05-12 02:39:32 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-05-12 02:39:32 +0300 |
commit | c2ce702b3bfff6faa25c6e2b145e41394d544d8d (patch) | |
tree | 4c9b36b91abcec8bac23d2d3d21a48efdf8be082 /sql | |
parent | d8f0b0c50e8b7b19b83bd3012b456c19b5cfbbc9 (diff) | |
parent | 47890151b47af55431a808e59af738a35d1a0bb7 (diff) | |
download | mariadb-git-c2ce702b3bfff6faa25c6e2b145e41394d544d8d.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_func.cc | 5 | ||||
-rw-r--r-- | sql/repl_failsafe.cc | 4 | ||||
-rw-r--r-- | sql/sql_analyse.cc | 12 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 22 |
4 files changed, 28 insertions, 15 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index d7e778171a0..aaea676fee1 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2376,7 +2376,10 @@ longlong user_var_entry::val_int(my_bool *null_value) case INT_RESULT: return *(longlong*) value; case STRING_RESULT: - return strtoull(value,NULL,10); // String is null terminated + { + int error; + return my_strtoll10(value, (char**) 0, &error);// String is null terminated + } case ROW_RESULT: DBUG_ASSERT(1); // Impossible break; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index f254ffb3df3..2a5381ae478 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -915,12 +915,14 @@ int load_master_data(THD* thd) setting active_mi, because init_master_info() sets active_mi with defaults. */ + int error; + if (init_master_info(active_mi, master_info_file, relay_log_info_file, 0)) send_error(thd, ER_MASTER_INFO); strmake(active_mi->master_log_name, row[0], sizeof(active_mi->master_log_name)); - active_mi->master_log_pos = strtoull(row[1], (char**) 0, 10); + active_mi->master_log_pos= my_strtoll10(row[1], (char**) 0, &error); /* at least in recent versions, the condition below should be false */ if (active_mi->master_log_pos < BIN_LOG_HEADER_SIZE) active_mi->master_log_pos = BIN_LOG_HEADER_SIZE; diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 3c9563165fe..68f7d45e81c 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -187,7 +187,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) } if (str == end && info->integers) { - info->ullval = (ulonglong) strtoull(begin ,NULL, 10); + char *endpos= (char*) end; + int error; + info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error); if (info->integers == 1) return 0; // a single number can't be zerofill info->maybe_zerofill = 1; @@ -199,7 +201,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) return 0; if ((str + 1) == end) // number was something like '123[.eE]' { - info->ullval = (ulonglong) strtoull(begin, NULL, 10); + char *endpos= (char*) str; + int error; + info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error); return 1; } if (*str == 'e' || *str == 'E') // number may be something like '1e+50' @@ -218,7 +222,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end if (str == end) // number was something like '123.000' { - info->ullval = (ulonglong) strtoull(begin, NULL, 10); + char *endpos= (char*) str; + int error; + info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error); return 1; } for (; str != end && my_isdigit(system_charset_info,*str); str++) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 25344fe84cd..0f29289ac25 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3636,18 +3636,20 @@ delete_limit_clause: }; ULONG_NUM: - NUM { $$= strtoul($1.str,NULL,10); } - | LONG_NUM { $$= (ulong) strtoll($1.str,NULL,10); } - | ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); } - | REAL_NUM { $$= strtoul($1.str,NULL,10); } - | FLOAT_NUM { $$= strtoul($1.str,NULL,10); }; + NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + | LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + | REAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + | FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + ; ulonglong_num: - NUM { $$= (ulonglong) strtoul($1.str,NULL,10); } - | ULONGLONG_NUM { $$= strtoull($1.str,NULL,10); } - | LONG_NUM { $$= (ulonglong) strtoll($1.str,NULL,10); } - | REAL_NUM { $$= strtoull($1.str,NULL,10); } - | FLOAT_NUM { $$= strtoull($1.str,NULL,10); }; + NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + | ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + | LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + | REAL_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + | FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + ; procedure_clause: /* empty */ |