Skip to content

[PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'PRIMARY' in 'where clause' #5778

@chadicus

Description

@chadicus

What are you trying to achieve?

I am using the Db module with a mariadb database.

What do you get instead?

I receive an error stating Unknown column 'PRIMARY'
The issue stems from the Mysql driver building the following query
SHOW KEYS FROM my_table where key_name = "PRIMARY"
Maria db does not treat double quotes as string literals.
By changing the query to
SHOW KEYS FROM my_table where key_name = 'PRIMARY'
using single quotes the issues is resolved. This should not affect mysql db users as single quotes are string literals

Provide console output if related. Use -vvv mode for more details.

# paste output here

Provide test source code if related

// paste test

Details

  • Codeception version: 3.1.2
  • PHP Version: 7.0
  • Operating System: Unbuntu
  • Installation type: Composer
  • List of installed packages (composer show)
  • Suite configuration:
# paste suite config here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions