Replaced the string "KEY" by "key" in the description for column name in table key_value.
Running OpenSuse 13.2
MariaDB 10.0.20
I've not been able to export and import the database, due to an SQL error. With "KEY" the export looks like:
CREATE TABLE IF NOT EXISTS `key_value` (
`collection` varchar(128) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'A named collection of key and value pairs.'
`value` longblob NOT NULL COMMENT 'The value.',
PRIMARY KEY (`collection`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Generic key-value storage table. See the state system for…';
The Column "name" is lost ...
Not big deal, but when you need to recover a system quickly and you are not aware about it, no fun ...
Comments
Comment #1
cilefen commentedComment #2
cilefen commentedComment #3
cilefen commentedI
Comment #4
cilefen commentedThe patch is simple and fixed the issue for me.
Comment #5
cilefen commentedI tested on MariaDB 10.0.20.
Comment #6
xjmUm, hm. That's... weird. I wonder if this is a bug in the way Maria parses exports? As far as I know any reserved word in the comment should be fine since it's quoted, and it's especially weird that the bug is case-sensitive like this. I can't find any resources with issues about SQL reserved words in column comments.
This fix might be fine since it resolves the bug, but it'd be good to know why it's happening so we can either document it or ensure that there isn't an underlying bug in Drupal. I think a DB subsystem maintainer's input or +1 would be good here. Pinging Crell in particular.
Comment #7
Crell commented... Wow, MariaDB. Wow.
Can we test this on a recent MySQL, too? I'm fine with the patch posted, but I too would like to have a better understanding of what's going on to know if we need to do anything else with it. I'll see if I can track down any MariaDB experts who might have some insight. My gut feeling is that it's a parser bug in MariaDB (or maybe MySQL as well? I've no idea), in which case we should at least make sure it gets reported upstream.
Comment #8
kthari85 commentedActually I am unable to run the create table from MySQL.
Is it really a MariaDB only error or is it related to MySQL also ? (Version : 5.6.24 )
Comment #9
btmash commentedI'm looking at this and there are a lot of issues with the SQL that was originally posted.
As far as I see, this is less an issue of MariaDB and more an issue of bad SQL.
Comment #10
btmash commentedOh, and there is no 'name' column definition. I initially thought value was what is being referred to.
If the case is against a dump of d8 and trying to recreate it, doing so now.
Comment #11
btmash commentedI just tried against a fresh sql-dump into Maria 10.0.20 and it worked without any issues.
Comment #12
Anonymous (not verified) commentedI also had no issue with a dump of a relatively fresh D8 (installed last week) on Percona XtraDB 5.6, MySQL 5.6, and MariaDB 10.0.20.
Comment #13
slowflyer commented@BTMash: The originally posted SQL is corrupt, thats why I posted this example
@Brian Altenhofel: Have you been able to import the dump?
Comment #14
btmash commented@slowflyer I understood that after the fact; I apologize for my comment. However, I was able to do a successful export/import of the dump.
Comment #15
Crell commentedSo based on the most recent comments, is this issue now a wont-fix red herring?
Comment #16
slowflyer commentedI had the issue, my suggested patch did fix the issue.
#4 the patch worked for cilefen as well.
Comment #17
cilefen commentedI definitely saw the issue in the configuration I mentioned.
Comment #18
btmash commented@slowflyer, @cilefen: How did you create the database dump? I've tried with drush-master, mysqldump and they both export/import correctly (again, with MariaDB-10.0.20). Mind you, I have tried this in Ubuntu and Debian and not in OpenSuse.
Comment #19
cilefen commented@BTMash phpMyAdmin 4.3.2. Maybe that's my problem.
Comment #20
slowflyer commented@BTMash: phpMyAdmin on my site as well, I will check with mysqldump tomorrow morning.
Comment #21
cilefen commentedHa - I think we may have the answer.
Comment #22
Anonymous (not verified) commentedOnly did Debian here. It seems a common denominator may be phpMyAdmin, but I'm not setup to test that. However, it looks like a known bug in phpMyAdmin that has been fixed since 4.3.13.0 (released 2015-03-29).
Comment #23
btmash commentedI can confirm being able to replicate this issue locally with phpMyAdmin (I have acquia dev desktop locally and was able to replicate the bad sql from the export since it uses phpMyAdmin 4.3.7). Will be able to try with newer versions soon-ish to see if there is an issue but atleast now we can confirm MariaDB is not cause of the issue. But phpMyAdmin may still contain the problem so we should keep the issue open.
Comment #24
cilefen commentedI tried and it is fixed in the 4.4.4 phpMyAdmin release. This is a phpMyAdmin bug that has been fixed. This is not a Drupal issue.