Skip to content
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

Valid ALTER USER statement throws validation error "unrecognized alter operation" #342

Closed
pcgeek86 opened this issue Aug 11, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@pcgeek86
Copy link

Describe the bug

When writing an ALTER USER statement in phpMyAdmin, a validation error is thrown, even though the query executes successfully.

To Reproduce

Steps to reproduce the behavior:

Put the following query into the phpMyAdmin SQL query editor.

ALTER USER trevor REQUIRE NONE;

Expected behavior

Query should not show any validation errors in the phpMyAdmin SQL editor.

Screenshots

image
image

Server configuration

  • Operating system: Windows 10 w/ Docker Desktop
  • Web server: Apache
  • Database version: MySQL 8.0.26
  • PHP version:
  • phpMyAdmin version: 5.1.1

Client configuration

  • Browser: Firefox 91
  • Operating system: Windows 10
@williamdes williamdes transferred this issue from phpmyadmin/phpmyadmin Aug 13, 2021
@williamdes williamdes added the bug label Aug 13, 2021
@williamdes williamdes added this to the 4.7.3 milestone Aug 13, 2021
@iifawzi
Copy link
Contributor

iifawzi commented Aug 15, 2021

In order for to fix this issue, I think we would need to create a USER_OPTIONS similar to

public static $DB_OPTIONS = [

to be used here:

$options = [];
if ($this->options->has('DATABASE')) {
$options = AlterOperation::$DB_OPTIONS;
} elseif ($this->options->has('TABLE')) {
$options = AlterOperation::$TABLE_OPTIONS;
} elseif ($this->options->has('VIEW')) {
$options = AlterOperation::$VIEW_OPTIONS;
}
$this->altered[] = AlterOperation::parse($parser, $list, $options);

otherwise; this will always be the error

if ($ret->options->isEmpty()) {
$parser->error('Unrecognized alter operation.', $list->tokens[$list->idx]);
}

I don't really know what's the full list of user options, if you could help me @williamdes I might be able to work on a fix.

@williamdes
Copy link
Member

@iifawzi you figured out before I finished writing my message here ^^

I was about to give you more details about options but here are the links:

williamdes added a commit that referenced this issue Aug 17, 2021
Signed-off-by: William Desportes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants