summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <monty@mysql.com/narttu.mysql.fi>2006-12-15 01:01:52 +0200
committerunknown <monty@mysql.com/narttu.mysql.fi>2006-12-15 01:01:52 +0200
commit2bcbffa0c50f5a09152d1b7b4de7a65abc9283b6 (patch)
treeb60f635d3126e8d0f1321f0187390d7cf8496558 /sql-common
parent39d873cf3ccad03bda9c751aebc6c59d4a126c91 (diff)
parentf00257ddd0a2f392f9b80c9cd5c405017e3a9d63 (diff)
downloadmariadb-git-2bcbffa0c50f5a09152d1b7b4de7a65abc9283b6.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0 client/mysql.cc: Auto merged client/mysql_upgrade.c: Auto merged client/mysqltest.c: Auto merged extra/yassl/include/yassl_imp.hpp: Auto merged extra/yassl/include/yassl_int.hpp: Auto merged extra/yassl/taocrypt/include/algebra.hpp: Auto merged extra/yassl/taocrypt/include/des.hpp: Auto merged extra/yassl/taocrypt/include/modes.hpp: Auto merged extra/yassl/taocrypt/src/aes.cpp: Auto merged extra/yassl/taocrypt/src/algebra.cpp: Auto merged extra/yassl/taocrypt/test/test.cpp: Auto merged include/my_sys.h: Auto merged libmysql/libmysql.c: Auto merged libmysqld/lib_sql.cc: Auto merged myisam/mi_open.c: Auto merged myisam/myisampack.c: Auto merged mysql-test/r/mysqltest.result: Auto merged mysql-test/t/mysqltest.test: Auto merged ndb/src/common/util/File.cpp: Auto merged ndb/src/common/util/socket_io.cpp: Auto merged ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Auto merged ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Auto merged ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Auto merged ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Auto merged ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Auto merged ndb/src/mgmsrv/Services.cpp: Auto merged ndb/tools/ndb_config.cpp: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_subselect.h: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_load.cc: Auto merged sql-common/my_time.c: Auto merged sql/sql_string.h: Auto merged sql/sql_table.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged strings/strtod.c: Auto merged tests/mysql_client_test.c: Auto merged extra/yassl/taocrypt/include/rsa.hpp: manual merge mysql-test/t/mysql.test: manual merge sql/sql_parse.cc: manual merge
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c4
-rw-r--r--sql-common/my_time.c57
2 files changed, 31 insertions, 30 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index c8984e29a34..ef7d0132ffb 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -2365,12 +2365,12 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
{
DYNAMIC_ARRAY *init_commands= mysql->options.init_commands;
char **ptr= (char**)init_commands->buffer;
- char **end= ptr + init_commands->elements;
+ char **end_command= ptr + init_commands->elements;
my_bool reconnect=mysql->reconnect;
mysql->reconnect=0;
- for (; ptr<end; ptr++)
+ for (; ptr < end_command; ptr++)
{
MYSQL_RES *res;
if (mysql_real_query(mysql,*ptr, (ulong) strlen(*ptr)))
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 2669f234143..fc68cebd987 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -681,24 +681,24 @@ fractional:
1 time value is invalid
*/
-int check_time_range(struct st_mysql_time *time, int *warning)
+int check_time_range(struct st_mysql_time *my_time, int *warning)
{
longlong hour;
- if (time->minute >= 60 || time->second >= 60)
+ if (my_time->minute >= 60 || my_time->second >= 60)
return 1;
- hour= time->hour + (24*time->day);
+ hour= my_time->hour + (24*my_time->day);
if (hour <= TIME_MAX_HOUR &&
- (hour != TIME_MAX_HOUR || time->minute != TIME_MAX_MINUTE ||
- time->second != TIME_MAX_SECOND || !time->second_part))
+ (hour != TIME_MAX_HOUR || my_time->minute != TIME_MAX_MINUTE ||
+ my_time->second != TIME_MAX_SECOND || !my_time->second_part))
return 0;
- time->day= 0;
- time->hour= TIME_MAX_HOUR;
- time->minute= TIME_MAX_MINUTE;
- time->second= TIME_MAX_SECOND;
- time->second_part= 0;
+ my_time->day= 0;
+ my_time->hour= TIME_MAX_HOUR;
+ my_time->minute= TIME_MAX_MINUTE;
+ my_time->second= TIME_MAX_SECOND;
+ my_time->second_part= 0;
*warning|= MYSQL_TIME_WARN_OUT_OF_RANGE;
return 0;
}
@@ -1149,22 +1149,23 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
/* Convert time value to integer in YYYYMMDDHHMMSS format */
-ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *time)
+ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *my_time)
{
- return ((ulonglong) (time->year * 10000UL +
- time->month * 100UL +
- time->day) * ULL(1000000) +
- (ulonglong) (time->hour * 10000UL +
- time->minute * 100UL +
- time->second));
+ return ((ulonglong) (my_time->year * 10000UL +
+ my_time->month * 100UL +
+ my_time->day) * ULL(1000000) +
+ (ulonglong) (my_time->hour * 10000UL +
+ my_time->minute * 100UL +
+ my_time->second));
}
/* Convert TIME value to integer in YYYYMMDD format */
-ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *time)
+ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *my_time)
{
- return (ulonglong) (time->year * 10000UL + time->month * 100UL + time->day);
+ return (ulonglong) (my_time->year * 10000UL + my_time->month * 100UL +
+ my_time->day);
}
@@ -1174,11 +1175,11 @@ ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *time)
it's assumed that days have been converted to hours already.
*/
-ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *time)
+ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *my_time)
{
- return (ulonglong) (time->hour * 10000UL +
- time->minute * 100UL +
- time->second);
+ return (ulonglong) (my_time->hour * 10000UL +
+ my_time->minute * 100UL +
+ my_time->second);
}
@@ -1202,15 +1203,15 @@ ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *time)
valid date either.
*/
-ulonglong TIME_to_ulonglong(const MYSQL_TIME *time)
+ulonglong TIME_to_ulonglong(const MYSQL_TIME *my_time)
{
- switch (time->time_type) {
+ switch (my_time->time_type) {
case MYSQL_TIMESTAMP_DATETIME:
- return TIME_to_ulonglong_datetime(time);
+ return TIME_to_ulonglong_datetime(my_time);
case MYSQL_TIMESTAMP_DATE:
- return TIME_to_ulonglong_date(time);
+ return TIME_to_ulonglong_date(my_time);
case MYSQL_TIMESTAMP_TIME:
- return TIME_to_ulonglong_time(time);
+ return TIME_to_ulonglong_time(my_time);
case MYSQL_TIMESTAMP_NONE:
case MYSQL_TIMESTAMP_ERROR:
return ULL(0);