[MDEV-25009] INSERT INTO view_name () VALUES () fails with ER_WRONG_VALUE_COUNT_ON_ROW Created: 2021-02-27  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Views
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: upstream-fixed


 Description   

An attempt to insert all default values into a view fails with "Column count doesn't match value count at row 1", while the same statement with the base table works all right. I couldn't find any explanation or a mention of such limitation in the docs.

CREATE TABLE t1 (i INT DEFAULT '0');
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO v1 () VALUES ();
 
# Cleanup
DROP VIEW v1;
DROP TABLE t1;

10.2 259e5243

mysqltest: At line 3: query 'INSERT INTO v1 () VALUES ()' failed: 1136: Column count doesn't match value count at row 1

Same with INSERT INTO v1 VALUES ().

Reproducible on all of MariaDB and previous versions of MySQL. It has been recently fixed in MySQL 8.0.22.


Generated at Thu Feb 08 09:34:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.