INSERT to table without PK possible with insertable VIEW when pxc_strict_mode=ENFORCING

Bug #1722493 reported by Iwo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Fix Committed
Medium
Unassigned
5.7
Fix Committed
Medium
Unassigned

Bug Description

When pxc_strict_mode is set to enforcing inserting data into a table without a primary key is still possible with insertable views.

mysql> select @@GLOBAL.pxc_strict_mode,@@pxc_strict_mode;
+--------------------------+-------------------+
| @@GLOBAL.pxc_strict_mode | @@pxc_strict_mode |
+--------------------------+-------------------+
| ENFORCING | ENFORCING |
+--------------------------+-------------------+

mysql> create table t_wo_pk (id int);

mysql> INSERT INTO t_wo_pk SET id =1;
ERROR 1105 (HY000): Percona-XtraDB-Cluster prohibits use of DML command on a table (test.t_wo_pk) without an explicit primary key with pxc_strict_mode = ENFORCING or MASTER

mysql> CREATE VIEW v_wo_pk AS SELECT id FROM t_wo_pk;
mysql> INSERT INTO v_wo_pk SET id = 1;
Query OK, 1 row affected (0.01 sec)

mysql> select * from t_wo_pk;
+------+
| id |
+------+
| 1 |
+------+

Tested against 5.7.19.

Iwo (percona.imp)
description: updated
Changed in percona-xtradb-cluster:
status: New → Fix Committed
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-880

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.