-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
array_key_exists warning when parsing a "DEFAULT FALSE" token #299
Comments
This still happens in latest PMA 5.0.3:
Any idea how this could be fixed? |
I added this to a milestone to have a fix as quickly as possible. |
Starting to work on this issue. |
I'm not sure how to replicate the issue. Any steps to replicate would be appreciated. 😄 |
Here you go, @shucon, you can reproduce it with the following simple DROP TABLE IF EXISTS `searches`;
CREATE TABLE `searches` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`public_name` varchar(120) COLLATE utf8_unicode_ci NOT NULL,
`group_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`shortdesc` tinytext COLLATE utf8_unicode_ci,
`show_separators` tinyint(1) NOT NULL DEFAULT '0',
`deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
ALTER TABLE `searches` ADD `admins_only` BOOLEAN NOT NULL DEFAULT FALSE AFTER `show_separators`; The problem only seems to occur, if we add a On a PMA 5.0.3 / phpmyadmin/sql-parser 5.4.0 import we then get the following warning:
Please let me know if you can now reproduce it. |
Signed-off-by: Saksham Gupta <[email protected]>
Hello @onlime thanks for a detailed explanation. I was able to reproduce the issue, but not consistently. Can you please verify that the above patch resolves the problem? |
Hi @shucon. Great, thanks! I have applied your patch and confirm it to be fully working (tried it with the stripped down .sql above and the full import of the customer with a bunch of such for those who forgot how to download a patch based on a commit on Github, here's you go: $ cd vendor/phpmyadmin/sql-parser/
$ wget https://github.com/shucon/sql-parser/commit/f6ac59ae87a1e548aa7e1dc39352fbb86b0f6da9.patch
$ patch -p1 < f6ac59ae87a1e548aa7e1dc39352fbb86b0f6da9.patch |
Signed-off-by: William Desportes <[email protected]>
…FAULT FALSE" token Pull-request: #314 Fixes: #299 Signed-off-by: William Desportes <[email protected]>
Signed-off-by: William Desportes <[email protected]>
Cheers |
A dump inside AlterOperation.php gives me the following result:
I don't have any idea if the
value
attribute should be a boolean in this case, so I'm not starting a PR right now. I don't know if the correct solution would be to cast to string on thearray_key_exists
itself, or to save thevalue
attribute as a string instead of a boolean...The text was updated successfully, but these errors were encountered: