Skip to content

check if "val-" exists in enum value#1259

Open
NReib wants to merge 1 commit into
vrana:masterfrom
NReib:patch-1
Open

check if "val-" exists in enum value#1259
NReib wants to merge 1 commit into
vrana:masterfrom
NReib:patch-1

Conversation

@NReib
Copy link
Copy Markdown

@NReib NReib commented Mar 27, 2026

Problem probably introduced in #1152
Some enum values seem to not be prefixed with "val-" leading to SQL Errors on insertion

Some enum values seem to not be prefixed with "val-" leading to SQL Errors on insertion
@NReib
Copy link
Copy Markdown
Author

NReib commented Mar 27, 2026

Just so you know what error this fixes: when adding an entry to a table with an enum, the first 4 letters of that enum were stripped, leading to an sql error in best case

@vrana
Copy link
Copy Markdown
Owner

vrana commented Apr 29, 2026

How can I reproduce this? Which driver? Are you using some plugins? What do you mean by “adding an entry to a table with an enum”?

@vrana vrana added the Waiting label Apr 29, 2026
@NReib
Copy link
Copy Markdown
Author

NReib commented Apr 30, 2026

We use Mariadb / mysqlnd 8.5.4. I'm not aware of any plugins used, but my instance of adminer is shipped with another OSS. Hope this helps.
Set up example table.

CREATE TABLE tasks (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    priority ENUM('low', 'medium', 'high') DEFAULT 'medium',
    status ENUM('pending', 'in_progress', 'completed', 'canceled') DEFAULT 'pending',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Open table in adminer and add new entry
Bildschirmfoto vom 2026-04-30 09-28-16

Bildschirmfoto vom 2026-04-30 09-29-03

Resulting SQL Error - first 4 characters are stripped for enums:
Data truncated for column 'priority' at row 1 09:29:44 SQL-Kommando 🗐
INSERT INTO tasks (title, priority, status, created_at)
VALUES ('', 'um', 'ing', now());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants