Skip to content

Commit 9ff7a0c

Browse files
author
cmiller@zippy.cornsilk.net
committed
Bug#26294: library name conflict between MySQL 4.x, 5.0 and Qt 3.3
When linking with some external programs, "multiple definition of `init_time'" Rename init_time() to my_init_time() to avoid collision with other libraries (particularly libmng).
1 parent 3bff5b5 commit 9ff7a0c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

client/mysqlbinlog.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ int main(int argc, char** argv)
14741474
DBUG_ENTER("main");
14751475
DBUG_PROCESS(argv[0]);
14761476

1477-
init_time(); // for time functions
1477+
my_init_time(); // for time functions
14781478

14791479
parse_args(&argc, (char***)&argv);
14801480
defaults_argv=argv;

include/my_time.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ long calc_daynr(uint year,uint month,uint day);
9494
uint calc_days_in_year(uint year);
9595
uint year_2000_handling(uint year);
9696

97-
void init_time(void);
97+
void my_init_time(void);
9898

9999

100100
/*

sql-common/my_time.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,9 @@ int check_time_range(struct st_mysql_time *my_time, int *warning)
704704
Prepare offset of system time zone from UTC for my_system_gmt_sec() func.
705705
706706
SYNOPSIS
707-
init_time()
707+
my_init_time()
708708
*/
709-
void init_time(void)
709+
void my_init_time(void)
710710
{
711711
time_t seconds;
712712
struct tm *l_time,tm_tmp;
@@ -795,7 +795,7 @@ long calc_daynr(uint year,uint month,uint day)
795795
NOTES
796796
The idea is to cache the time zone offset from UTC (including daylight
797797
saving time) for the next call to make things faster. But currently we
798-
just calculate this offset during startup (by calling init_time()
798+
just calculate this offset during startup (by calling my_init_time()
799799
function) and use it all the time.
800800
Time value provided should be legal time value (e.g. '2003-01-01 25:00:00'
801801
is not allowed).

sql/init.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void unireg_init(ulong options)
3030
wild_many='%'; wild_one='_'; wild_prefix='\\'; /* Change to sql syntax */
3131

3232
current_pid=(ulong) getpid(); /* Save for later ref */
33-
init_time(); /* Init time-functions (read zone) */
33+
my_init_time(); /* Init time-functions (read zone) */
3434
#ifndef EMBEDDED_LIBRARY
3535
my_abort_hook=unireg_abort; /* Abort with close of databases */
3636
#endif

sql/tztime.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ class Time_zone_system : public Time_zone
10351035
return lowest possible my_time_t in case of ambiguity or if we
10361036
provide time corresponding to the time-gap.
10371037
1038-
You should call init_time() function before using this function.
1038+
You should call my_init_time() function before using this function.
10391039
10401040
RETURN VALUE
10411041
Corresponding my_time_t value or 0 in case of error
@@ -2757,7 +2757,7 @@ main(int argc, char **argv)
27572757
}
27582758
printf("gmt_sec_to_TIME = localtime for time_t in [1000000000,1100000000) range\n");
27592759

2760-
init_time();
2760+
my_init_time();
27612761

27622762
/*
27632763
Be careful here! my_system_gmt_sec doesn't fully handle unnormalized

0 commit comments

Comments
 (0)