Skip to content

SELECT ... FOR UPDATE causes LIMIT syntax error #17190

Closed
@cjhewett

Description

@cjhewett

Describe the bug

InnoDB supports the syntax SELECT ... FOR UPDATE to allow row level locking. When run in PMA this statement causes an SQL error as the LIMIT clause appears to be injected into the wrong place within it.

To Reproduce

Steps to reproduce the behavior:

  1. Go to for 5.1 demo server https://www.phpmyadmin.net/try/ and use MariaDB
  2. Run SELECT * FROM information_schema.CHARACTER_SETS FOR UPDATE;
  3. See error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 0, 25' at line 1

Expected behavior

The statement should run correctly.

Screenshots

image

Server configuration

  • Database version: 10.4.8-MariaDB-1:10.4.8+maria~stretch-log - mariadb.org binary distribution
  • PHP version: 7.4.25
  • phpMyAdmin version: 5.1.2-dev

Additional context

If the LIMIT clause is manually entered, it does run with no error SELECT * FROM information_schema.CHARACTER_SETS LIMIT 1 FOR UPDATE;

image

There are other combinations, like FOR SHARE and SKIP LOCKED which probably exhibit the same issues.

Metadata

Metadata

Assignees

Labels

BugA problem or regression with an existing featureparser

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions