Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.6, 10.11
-
None
Description
Hi,
it looks like mariadb-tzinfo-to-sql generates some sql statements that only run under certain conditions:
empty sql_mode, working fine:
mysql@host[~](test)> mysql -BN -e "set @@global.sql_mode = ''"
|
mysql@host[~](test)> mariadb-tzinfo-to-sql /usr/share/zoneinfo/ | mysql mysql
|
mysql@host[~](test)>
|
mysql@host[~](test)> mysql -BN -e "set @@global.sql_mode = 'ansi_quotes'"
|
mysql@host[~](test)> mariadb-tzinfo-to-sql /usr/share/zoneinfo/ | mysql -f mysql
|
ERROR 1054 (42S22) at line 4: Unknown column 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'' in 'field list'
|
ERROR 1054 (42S22) at line 6: Unknown column 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'' in 'field list'
|
ERROR 1054 (42S22) at line 8: Unknown column 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'' in 'field list'
|
ERROR 1054 (42S22) at line 10: Unknown column 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'' in 'field list'
|
statements that cause the issue have double quotes in line 5,7,9,11
1
|
mysql@host[~](test)> mariadb-tzinfo-to-sql /usr/share/zoneinfo/ | head -12
|
2
|
set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
|
3
|
SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
|
4
|
set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
|
5
|
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
|
6
|
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
|
7
|
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
|
8
|
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0');
|
9
|
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0');
|
10
|
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
|
11
|
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0');
|
12
|
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
|
13
|
TRUNCATE TABLE time_zone;
|
Attachments
Issue Links
- relates to
-
MDEV-18778 mysql_tzinfo_to_sql does not work correctly in MariaDB Galera
-
- Closed
-
-
MDEV-28263 mariadb-tzinfo-to-sql binlog, embedded, and performance fixes
-
- Closed
-
-
MDEV-28782 mariadb-tzinfo-to-sql to work in bootstrap mode
-
- Closed
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.11 [ 27614 ] | |
Affects Version/s | 10.6.12 [ 28513 ] | |
Affects Version/s | 10.11.2 [ 28523 ] |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
Remote Link | This issue links to "PR #2604 (Web Link)" [ 35213 ] |
Assignee | Daniel Black [ danblack ] |
Fix Version/s | 10.6.13 [ 28514 ] | |
Fix Version/s | 10.9.6 [ 28520 ] | |
Fix Version/s | 10.10.4 [ 28522 ] | |
Fix Version/s | 10.11.3 [ 28524 ] | |
Fix Version/s | 11.1.1 [ 28704 ] | |
Fix Version/s | 10.8.8 [ 28518 ] | |
Fix Version/s | 11.0.2 [ 28706 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Closely related to
MDEV-18778,MDEV-28263, andMDEV-28782.The common feature: there's a lack of testing of whether or not the generated timezone.sql actually works in different build and execution environments.