summaryrefslogtreecommitdiff
path: root/sql/sql_analyse.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-08-22 00:18:32 +0300
committerunknown <monty@donna.mysql.com>2000-08-22 00:18:32 +0300
commit90104181f979b04de0a2889c2299c0add02d949c (patch)
treec129c5ccdb3df8c87c28c6a51baac6e208294313 /sql/sql_analyse.cc
parent90bc6094eed4bde988bad568ac48bd686a127639 (diff)
downloadmariadb-git-90104181f979b04de0a2889c2299c0add02d949c.tar.gz
FLUSH TABLE table_list
Fixes for RENAME TABLE Portability fixes Docs/manual.texi: FLUSH TABLES table_list client/mysql.cc: Ia64 port client/mysqladmin.c: Ia64 port client/mysqldump.c: Ia64 port client/mysqlimport.c: Ia64 port client/mysqlshow.c: Ia64 port client/readline.cc: Ia64 port configure.in: Ia64 port include/config-win.h: Ia64 port include/thr_alarm.h: Ia64 port myisam/myisamdef.h: Ia64 port myisammrg/myrg_rkey.c: Ia64 port mysys/thr_alarm.c: Easier compile of non threaded client mysys/thr_lock.c: Easier compile of non threaded client mysys/thr_mutex.c: Easier compile of non threaded client sql-bench/crash-me.sh: Added test for RENAME + some ANSI SQL99 group functions sql-bench/limits/mysql.cfg: New run sql-bench/server-cfg.sh: Fix sql-bench/test-insert.sh: Fix sql/field.cc: Port to Ia64 sql/ha_berkeley.cc: Port to Ia64 sql/ha_myisam.cc: cleanup sql/handler.cc: Port to Ia64 sql/hostname.cc: Port to Ia64 sql/item.cc: Port to Ia64 sql/item_create.cc: Port to Ia64 sql/item_func.cc: Port to Ia64 sql/item_strfunc.cc: Port to Ia64 sql/item_timefunc.cc: Port to Ia64 sql/lock.cc: Fix for RENAME sql/log.cc: Port to Ia64 sql/log_event.h: Port to Ia64 sql/mini_client.cc: Port to Ia64 sql/mysql_priv.h: Port to Ia64 sql/mysqlbinlog.cc: Port to Ia64 sql/mysqld.cc: FLUSH TABLES table_list sql/net_pkg.cc: Port to Ia64 sql/procedure.h: Port to Ia64 sql/share/swedish/errmsg.OLD: FLUSH TABLES table_list sql/slave.cc: Port to Ia64 sql/sql_acl.cc: Port to Ia64 sql/sql_analyse.cc: Port to Ia64 sql/sql_analyse.h: Port to Ia64 sql/sql_base.cc: FLUSH TABLES table_list sql/sql_class.cc: Port to Ia64 sql/sql_class.h: Port to Ia64 sql/sql_parse.cc: Port to Ia64 sql/sql_rename.cc: Fix of RENAME sql/sql_show.cc: Port to Ia64 sql/sql_string.cc: Port to Ia64 sql/sql_string.h: Port to Ia64 sql/sql_table.cc: Fix of RENAME sql/sql_udf.cc: Port to Ia64 sql/sql_yacc.yy: FLUSH TABLES table_list sql/table.cc: Port to Ia64 sql/thr_malloc.cc: Port to Ia64 sql/time.cc: Port to Ia64 sql/unireg.cc: Port to Ia64
Diffstat (limited to 'sql/sql_analyse.cc')
-rw-r--r--sql/sql_analyse.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 4794a23976b..96525822c52 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -352,14 +352,19 @@ void field_real::add()
if ((decs = decimals()) == NOT_FIXED_DEC)
{
sprintf(buff, "%g", num);
- length = strlen(buff);
+ length = (uint) strlen(buff);
if (rint(num) != num)
max_notzero_dec_len = 1;
}
else
{
+#ifdef HAVE_SNPRINTF
+ snprintf(buff, sizeof(buff), "%-.*f", (int) decs, num);
+#else
sprintf(buff, "%-.*f", (int) decs, num);
- length = strlen(buff);
+#endif
+
+ length = (uint) strlen(buff);
// We never need to check further than this
end = buff + length - 1 - decs + max_notzero_dec_len;
@@ -686,7 +691,7 @@ void field_str::get_opt_type(String *answer, ha_rows total_rows)
sprintf(buff, "INT(%d)", num_info.integers);
else
sprintf(buff, "BIGINT(%d)", num_info.integers);
- answer->append(buff, strlen(buff));
+ answer->append(buff, (uint) strlen(buff));
if (ev_num_info.llval >= 0 && ev_num_info.min_dval >= 0)
answer->append(" UNSIGNED");
if (num_info.zerofill)
@@ -704,12 +709,12 @@ void field_str::get_opt_type(String *answer, ha_rows total_rows)
else if ((max_length * (total_rows - nulls)) < (sum + total_rows))
{
sprintf(buff, "CHAR(%d)", (int) max_length);
- answer->append(buff, strlen(buff));
+ answer->append(buff, (uint) strlen(buff));
}
else
{
sprintf(buff, "VARCHAR(%d)", (int) max_length);
- answer->append(buff, strlen(buff));
+ answer->append(buff, (uint) strlen(buff));
}
}
else if (max_length < (1L << 16))
@@ -756,7 +761,7 @@ void field_real::get_opt_type(String *answer,
sprintf(buff, "INT(%d)", (int) max_length - (item->decimals + 1));
else
sprintf(buff, "BIGINT(%d)", (int) max_length - (item->decimals + 1));
- answer->append(buff, strlen(buff));
+ answer->append(buff, (uint) strlen(buff));
if (min_arg >= 0)
answer->append(" UNSIGNED");
}
@@ -768,7 +773,7 @@ void field_real::get_opt_type(String *answer,
else
sprintf(buff, "DOUBLE(%d,%d)", (int) max_length - (item->decimals + 1),
max_notzero_dec_len);
- answer->append(buff, strlen(buff));
+ answer->append(buff, (uint) strlen(buff));
}
// if item is FIELD_ITEM, it _must_be_ Field_num in this class
if (item->type() == Item::FIELD_ITEM &&
@@ -797,7 +802,7 @@ void field_longlong::get_opt_type(String *answer,
sprintf(buff, "INT(%d)", (int) max_length);
else
sprintf(buff, "BIGINT(%d)", (int) max_length);
- answer->append(buff, strlen(buff));
+ answer->append(buff, (uint) strlen(buff));
if (min_arg >= 0)
answer->append(" UNSIGNED");
@@ -826,7 +831,7 @@ void field_ulonglong::get_opt_type(String *answer,
else
sprintf(buff, "BIGINT(%d) UNSIGNED", (int) max_length);
// if item is FIELD_ITEM, it _must_be_ Field_num in this class
- answer->append(buff, strlen(buff));
+ answer->append(buff, (uint) strlen(buff));
if (item->type() == Item::FIELD_ITEM &&
// a single number shouldn't be zerofill
max_length != 1 &&