diff options
Diffstat (limited to 'sql/sql_analyse.cc')
-rw-r--r-- | sql/sql_analyse.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 24169fddb97..91b7e2a8636 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2011, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -248,7 +248,8 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) } DBUG_RETURN(0); } - for (str++; *(end - 1) == '0'; end--) ; // jump over zeros at the end + for (str++; *(end - 1) == '0'; end--) // jump over zeros at the end + ; if (str == end) // number was something like '123.000' { char *endpos= (char*) str; @@ -410,7 +411,7 @@ void field_real::add() if ((decs = decimals()) == NOT_FIXED_DEC) { - length= sprintf(buff, "%g", num); + length= my_sprintf(buff, (buff, "%g", num)); if (rint(num) != num) max_notzero_dec_len = 1; } @@ -421,7 +422,7 @@ void field_real::add() snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num); length = (uint) strlen(buff); #else - length= sprintf(buff, "%-.*f", (int) decs, num); + length= my_sprintf(buff, (buff, "%-.*f", (int) decs, num)); #endif // We never need to check further than this @@ -754,7 +755,7 @@ int analyse::end_of_records() tmp_str.append(STRING_WITH_LEN(" NOT NULL")); output_str_length = tmp_str.length(); func_items[9]->set(tmp_str.ptr(), tmp_str.length(), tmp_str.charset()); - if (result->send_data(result_fields)) + if (result->send_data(result_fields) > 0) return -1; continue; } @@ -799,7 +800,7 @@ int analyse::end_of_records() if (!(*f)->nulls) ans.append(STRING_WITH_LEN(" NOT NULL")); func_items[9]->set(ans.ptr(), ans.length(), ans.charset()); - if (result->send_data(result_fields)) + if (result->send_data(result_fields) > 0) return -1; } return 0; @@ -1008,9 +1009,9 @@ void field_decimal::get_opt_type(String *answer, my_decimal_set_zero(&zero); my_bool is_unsigned= (my_decimal_cmp(&zero, &min_arg) >= 0); - length= my_snprintf(buff, sizeof(buff), "DECIMAL(%d, %d)", - (int) (max_length - (item->decimals ? 1 : 0)), - item->decimals); + length= my_sprintf(buff, (buff, "DECIMAL(%d, %d)", + (int) (max_length - (item->decimals ? 1 : 0)), + item->decimals)); if (is_unsigned) length= (uint) (strmov(buff+length, " UNSIGNED")- buff); answer->append(buff, length); |