Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d7463f8e
Commit
d7463f8e
authored
Nov 13, 2013
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge 5.3 -> 5.5
parents
f3a78f39
e4608eb3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
4 deletions
+82
-4
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+7
-0
mysql-test/r/mysql_tzinfo_to_sql_symlink.result
mysql-test/r/mysql_tzinfo_to_sql_symlink.result
+22
-0
mysql-test/std_data/zoneinfo/GMT
mysql-test/std_data/zoneinfo/GMT
+0
-0
mysql-test/t/mysql_tzinfo_to_sql_symlink.test
mysql-test/t/mysql_tzinfo_to_sql_symlink.test
+15
-0
sql/opt_subselect.cc
sql/opt_subselect.cc
+0
-1
sql/tztime.cc
sql/tztime.cc
+38
-3
No files found.
mysql-test/mysql-test-run.pl
View file @
d7463f8e
...
...
@@ -2490,6 +2490,13 @@ sub environment_setup {
"
$path_client_bindir
/perror
");
$ENV
{'
MY_PERROR
'}
=
native_path
(
$exe_perror
);
# ----------------------------------------------------
# mysql_tzinfo_to_sql
# ----------------------------------------------------
my
$exe_mysql_tzinfo_to_sql
=
mtr_exe_exists
("
$basedir
/sql
$opt_vs_config
/mysql_tzinfo_to_sql
",
"
$path_client_bindir
/mysql_tzinfo_to_sql
");
$ENV
{'
MYSQL_TZINFO_TO_SQL
'}
=
native_path
(
$exe_mysql_tzinfo_to_sql
);
# Create an environment variable to make it possible
# to detect that valgrind is being used from test cases
$ENV
{'
VALGRIND_TEST
'}
=
$opt_valgrind
;
...
...
mysql-test/r/mysql_tzinfo_to_sql_symlink.result
0 → 100644
View file @
d7463f8e
#
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
#
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'GMT')
;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'GMT')
;
Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
mysql-test/std_data/zoneinfo/GMT
0 → 100644
View file @
d7463f8e
File added
mysql-test/t/mysql_tzinfo_to_sql_symlink.test
0 → 100644
View file @
d7463f8e
--
source
include
/
have_symlink
.
inc
--
source
include
/
not_windows
.
inc
--
echo
#
--
echo
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
--
echo
#
--
exec
mkdir
$MYSQLTEST_VARDIR
/
zoneinfo
--
exec
ln
-
s
$MYSQLTEST_VARDIR
/
zoneinfo
$MYSQLTEST_VARDIR
/
zoneinfo
/
posix
--
copy_file
std_data
/
zoneinfo
/
GMT
$MYSQLTEST_VARDIR
/
zoneinfo
/
GMT
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
exec
$MYSQL_TZINFO_TO_SQL
$MYSQLTEST_VARDIR
/
zoneinfo
2
>&
1
--
exec
rm
-
rf
$MYSQLTEST_VARDIR
/
zoneinfo
sql/opt_subselect.cc
View file @
d7463f8e
...
...
@@ -1307,7 +1307,6 @@ static bool replace_where_subcondition(JOIN *join, Item **expr,
}
else
if
(
item
->
type
()
==
Item
::
COND_ITEM
)
{
DBUG_ASSERT
(
!
do_fix_fields
||
!
(
*
expr
)
->
fixed
);
replace_where_subcondition
(
join
,
li
.
ref
(),
old_cond
,
new_cond
,
do_fix_fields
);
...
...
sql/tztime.cc
View file @
d7463f8e
...
...
@@ -2494,7 +2494,7 @@ char *root_name_end;
*/
my_bool
scan_tz_dir
(
char
*
name_end
)
scan_tz_dir
(
char
*
name_end
,
uint
symlink_recursion_level
)
{
MY_DIR
*
cur_dir
;
char
*
name_end_tmp
;
...
...
@@ -2514,7 +2514,32 @@ scan_tz_dir(char * name_end)
if
(
MY_S_ISDIR
(
cur_dir
->
dir_entry
[
i
].
mystat
->
st_mode
))
{
if
(
scan_tz_dir
(
name_end_tmp
))
my_bool
is_symlink
;
if
((
is_symlink
=
my_is_symlink
(
fullname
))
&&
symlink_recursion_level
>
0
)
{
/*
The timezone definition data in some Linux distributions
(e.g. the "timezone-data-2013f" package in Gentoo)
may have synlimks like:
/usr/share/zoneinfo/posix/ -> /usr/share/zoneinfo/,
so the same timezone files are available under two names
(e.g. "CET" and "posix/CET").
We allow one level of symlink recursion for backward
compatibility with earlier timezone data packages that have
duplicate copies of the same timezone files inside the root
directory and the "posix" subdirectory (instead of symlinking).
This makes "posix/CET" still available, but helps to avoid
following such symlinks infinitely:
/usr/share/zoneinfo/posix/posix/posix/.../posix/
*/
fflush
(
stdout
);
fprintf
(
stderr
,
"Warning: Skipping directory '%s': "
"to avoid infinite symlink recursion.
\n
"
,
fullname
);
continue
;
}
if
(
scan_tz_dir
(
name_end_tmp
,
symlink_recursion_level
+
is_symlink
))
{
my_dirend
(
cur_dir
);
return
1
;
...
...
@@ -2526,16 +2551,22 @@ scan_tz_dir(char * name_end)
if
(
!
tz_load
(
fullname
,
&
tz_info
,
&
tz_storage
))
print_tz_as_sql
(
root_name_end
+
1
,
&
tz_info
);
else
{
fflush
(
stdout
);
fprintf
(
stderr
,
"Warning: Unable to load '%s' as time zone. Skipping it.
\n
"
,
fullname
);
}
free_root
(
&
tz_storage
,
MYF
(
0
));
}
else
{
fflush
(
stdout
);
fprintf
(
stderr
,
"Warning: '%s' is not regular file or directory
\n
"
,
fullname
);
}
}
}
my_dirend
(
cur_dir
);
...
...
@@ -2566,8 +2597,9 @@ main(int argc, char **argv)
printf
(
"TRUNCATE TABLE time_zone_transition;
\n
"
);
printf
(
"TRUNCATE TABLE time_zone_transition_type;
\n
"
);
if
(
scan_tz_dir
(
root_name_end
))
if
(
scan_tz_dir
(
root_name_end
,
0
))
{
fflush
(
stdout
);
fprintf
(
stderr
,
"There were fatal errors during processing "
"of zoneinfo directory
\n
"
);
return
1
;
...
...
@@ -2586,6 +2618,7 @@ main(int argc, char **argv)
{
if
(
tz_load
(
argv
[
2
],
&
tz_info
,
&
tz_storage
))
{
fflush
(
stdout
);
fprintf
(
stderr
,
"Problems with zoneinfo file '%s'
\n
"
,
argv
[
2
]);
return
1
;
}
...
...
@@ -2595,6 +2628,7 @@ main(int argc, char **argv)
{
if
(
tz_load
(
argv
[
1
],
&
tz_info
,
&
tz_storage
))
{
fflush
(
stdout
);
fprintf
(
stderr
,
"Problems with zoneinfo file '%s'
\n
"
,
argv
[
2
]);
return
1
;
}
...
...
@@ -2604,6 +2638,7 @@ main(int argc, char **argv)
free_root
(
&
tz_storage
,
MYF
(
0
));
}
my_end
(
0
);
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment