summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authormonty@mysql.com/narttu.mysql.fi <>2007-02-21 14:07:08 +0200
committermonty@mysql.com/narttu.mysql.fi <>2007-02-21 14:07:08 +0200
commit26aa385bc5278ec0ae842cf6558d8fd32b6876f1 (patch)
tree57fb0c9c6c3686011b021c42671cf5065cdc0cf6 /sql-common
parent37cedb7efad7568b496eb981e40a0910c0e22494 (diff)
parent222e128b34e7cfa67270a03c3d690d81dc0bc17b (diff)
downloadmariadb-git-26aa385bc5278ec0ae842cf6558d8fd32b6876f1.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
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 a627619550a..1acaaea9a79 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -2370,12 +2370,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 8496c0ceba1..446ae59f452 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -680,24 +680,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;
}
@@ -1148,22 +1148,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);
}
@@ -1173,11 +1174,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);
}
@@ -1201,15 +1202,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);