summaryrefslogtreecommitdiff
path: root/sql/tztime.cc
diff options
context:
space:
mode:
authorunknown <monty@mishka.local>2005-07-31 12:49:55 +0300
committerunknown <monty@mishka.local>2005-07-31 12:49:55 +0300
commitf5589f211e071f2512e167aec326860a5f0e681d (patch)
treec4df327e7bc6c594e03c6454dddbc63a93203c6a /sql/tztime.cc
parent3bd6699f723efabe925ca5680b85a2cd08b3006d (diff)
downloadmariadb-git-f5589f211e071f2512e167aec326860a5f0e681d.tar.gz
Fixes during review of new pushed code
Change bool in C code to my_bool Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests Added comparison of LEX_STRING's and use this to compare file types for view and trigger files. client/client_priv.h: Added OPT_TRIGGERS (to get rid of compiler warning) client/mysql.cc: Added cast to get rid of compiler warning client/mysqldump.c: Added OPT_TRIGGERS (to get rid of compiler warning) Abort if we can't write to outfile (even if --ignore-errors is given) client/mysqltest.c: Added --enable_parsning and --disable_parsing to avoid to have to comment parts of tests include/my_sys.h: Make my_progname const include/my_time.h: Avoid using 'bool' in C programs mysql-test/lib/init_db.sql: Align with mysql_create_system_tables (Ideally this file should be auto-generated from the above script) mysql-test/r/mysqltest.result: Test for --enable_parsing mysql-test/r/variables.result: Update results after fix for overflow checking of max_heap_table_size mysql-test/t/information_schema.test: USe --enable/disable parsing instead of comments mysql-test/t/mysqltest.test: Test for --enable_parsing mysql-test/t/sp.test: USe --enable/disable parsing instead of comments mysql-test/t/variables.test: Portability fix for 64 bit systems mysql-test/t/view.test: USe --enable/disable parsing instead of comments mysys/my_init.c: May my_progname const mysys/my_static.c: May my_progname const mysys/thr_lock.c: Remove not needed casts sql-common/my_time.c: Change bool -> my_bool as bool is not portable in C programs sql/field.cc: Test number_to_datetime() for -1 instead of < 0 (Safety fix) New prototype for TIME_to_timestamp() sql/item.h: Don't have prototypes for both uint32 and ulong as these 'may' be the same thing sql/item_timefunc.cc: New prototype for TIME_to_timestamp() sql/log.cc: Remove compiler warnings sql/mysql_priv.h: New prototype for TIME_to_timestamp() Added function for comparing LEX_STRING sql/set_var.cc: Added overflow checking when setting ulong variable sql/sql_base.cc: Added function is_equal() Changed strncmp -> is_equal() as strncmp() to not match "V" (instead of "VIEW") sql/sql_class.cc: Added comment sql/sql_select.cc: Portability fixes After review fixes sql/sql_trigger.cc: Use 'tables_alias_charset' for comparing database name Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly) sql/sql_view.cc: Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly) sql/time.cc: New prototype for TIME_to_timestamp() to allow easyer mapping to C function sql/tztime.cc: bool -> my_bool (to allow calling C code from C++ code) sql/tztime.h: bool -> my_bool (to allow calling C code from C++ code)
Diffstat (limited to 'sql/tztime.cc')
-rw-r--r--sql/tztime.cc34
1 files changed, 22 insertions, 12 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc
index f5111459da2..5a907f0d170 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -880,12 +880,12 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec)
0 in case of error.
*/
static my_time_t
-TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap)
+TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp,
+ my_bool *in_dst_time_gap)
{
my_time_t local_t;
uint saved_seconds;
uint i;
-
DBUG_ENTER("TIME_to_gmt_sec");
/* We need this for correct leap seconds handling */
@@ -962,7 +962,7 @@ class Time_zone_system : public Time_zone
{
public:
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const;
+ my_bool *in_dst_time_gap) const;
virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
};
@@ -994,7 +994,7 @@ public:
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_system::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const
+Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
{
long not_used;
return my_system_gmt_sec(t, &not_used, in_dst_time_gap);
@@ -1055,7 +1055,7 @@ class Time_zone_utc : public Time_zone
{
public:
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const;
+ my_bool *in_dst_time_gap) const;
virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
};
@@ -1081,7 +1081,7 @@ public:
0
*/
my_time_t
-Time_zone_utc::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const
+Time_zone_utc::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
{
/* Should be never called */
DBUG_ASSERT(0);
@@ -1144,7 +1144,7 @@ class Time_zone_db : public Time_zone
public:
Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg);
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const;
+ my_bool *in_dst_time_gap) const;
virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
private:
@@ -1193,7 +1193,7 @@ Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg,
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_db::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const
+Time_zone_db::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
{
return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap);
}
@@ -1240,7 +1240,7 @@ class Time_zone_offset : public Time_zone
public:
Time_zone_offset(long tz_offset_arg);
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const;
+ my_bool *in_dst_time_gap) const;
virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
/*
@@ -1292,7 +1292,7 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg):
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_offset::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const
+Time_zone_offset::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
{
return sec_since_epoch(t->year, t->month, t->day,
t->hour, t->minute, t->second) -
@@ -2549,8 +2549,6 @@ main(int argc, char **argv)
time_t t, t1, t2;
char fullname[FN_REFLEN+1];
char *str_end;
- long not_used;
- bool not_used_2;
MEM_ROOT tz_storage;
MY_INIT(argv[0]);
@@ -2660,14 +2658,21 @@ main(int argc, char **argv)
dates.
*/
for (time_tmp.year= 1980; time_tmp.year < 2010; time_tmp.year++)
+ {
for (time_tmp.month= 1; time_tmp.month < 13; time_tmp.month++)
+ {
for (time_tmp.day= 1;
time_tmp.day < mon_lengths[isleap(time_tmp.year)][time_tmp.month-1];
time_tmp.day++)
+ {
for (time_tmp.hour= 0; time_tmp.hour < 24; time_tmp.hour++)
+ {
for (time_tmp.minute= 0; time_tmp.minute < 60; time_tmp.minute+= 5)
+ {
for (time_tmp.second=0; time_tmp.second<60; time_tmp.second+=25)
{
+ long not_used;
+ my_bool not_used_2;
t= (time_t)my_system_gmt_sec(&time_tmp, &not_used, &not_used_2);
t1= (time_t)TIME_to_gmt_sec(&time_tmp, &tz_info, &not_used_2);
if (t != t1)
@@ -2699,6 +2704,11 @@ main(int argc, char **argv)
return 1;
}
}
+ }
+ }
+ }
+ }
+ }
printf("TIME_to_gmt_sec = my_system_gmt_sec for test range\n");