1136ERRORTier 1 — Safe✅ HIGH confidenceColumn count doesn't match value count
What this means
Error 1136 (SQLSTATE 21S01) is raised when an INSERT statement specifies a different number of values than there are columns in the target list. This is a compile-time check performed before any data is written.
Why it happens
- 1INSERT INTO t VALUES (...) with the wrong number of values for the table column count
- 2INSERT INTO t (col1, col2) VALUES (val1, val2, val3) — more values than columns listed
- 3An INSERT ... SELECT where the SELECT returns a different number of columns than the INSERT column list
How to reproduce
An INSERT provides three values for a two-column table.
CREATE TABLE users (id INT, email VARCHAR(255));
INSERT INTO users VALUES (1, 'alice@example.com', 'extra_value');Fix 1: Explicitly list the target columns
Always — explicit column lists make INSERTs robust against schema changes.
INSERT INTO users (id, email) VALUES (1, 'alice@example.com');Why this works
Listing the column names makes the mapping between values and columns explicit. If a column is added to the table later, the INSERT continues to work correctly without modification.
What not to do
Use INSERT INTO t VALUES (...) without column names
Why it's wrong: Positional INSERTs break silently when columns are added, reordered, or removed from the table — producing 1136 or, worse, inserting data into the wrong columns.
Version notes
All versionsStable error code. The row number is included in the error message when multiple rows are inserted with a single statement.Sources
📚 Official docs: https://mariadb.com/kb/en/insert/
🔧 Source ref: MariaDB Server error code 1136 / ER_WRONG_VALUE_COUNT_ON_ROW
📖 Further reading: MariaDB INSERT syntax
Confidence assessment
✅ HIGH confidence
Stable.
See also
📄 Reference pages