mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-23626: CONNECT VIR tables return inconsistent error for UPDATE
- Before the patch UPDATE error message for VIR tables was different from TRUNCATE,UPDATE,DELETE Reviewed by: <Olivier Bertrand>, vicentiu@mariadb.org
This commit is contained in:
parent
c62843a055
commit
1118b66a22
3 changed files with 38 additions and 0 deletions
|
@ -297,6 +297,13 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
|
|||
PTDB utp;
|
||||
|
||||
if (!(utp = tdbp->Duplicate(g))) {
|
||||
/* If table type is of type virtual retrieve global parameter as it was.*/
|
||||
if (tdbp->GetAmType() == TYPE_AM_VIR) {
|
||||
if (tdbp->OpenDB(g)) {
|
||||
printf("%s\n", g->Message);
|
||||
throw 7;
|
||||
}
|
||||
}
|
||||
sprintf(g->Message, MSG(INV_UPDT_TABLE), tdbp->GetName());
|
||||
throw 4;
|
||||
} // endif tp
|
||||
|
|
|
@ -16,3 +16,17 @@ SELECT * FROM t1;
|
|||
a
|
||||
10
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-23626: CONNECT VIR tables return inconsistent error for UPDATE
|
||||
#
|
||||
CREATE TABLE numbers
|
||||
ENGINE=CONNECT,
|
||||
TABLE_TYPE=VIR,
|
||||
BLOCK_SIZE=3;
|
||||
TRUNCATE TABLE numbers;
|
||||
ERROR HY000: Got error 174 'Virtual tables are read only' from CONNECT
|
||||
DELETE FROM numbers WHERE n = 1;
|
||||
ERROR HY000: Got error 174 'Virtual tables are read only' from CONNECT
|
||||
UPDATE numbers SET n = 10 WHERE n = 1;
|
||||
ERROR HY000: Got error 174 'Virtual tables are read only' from CONNECT
|
||||
DROP TABLE numbers;
|
||||
|
|
|
@ -14,3 +14,20 @@ SELECT * FROM t1;
|
|||
ALTER TABLE t1 TABLE_TYPE=NON_EXISTING;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-23626: CONNECT VIR tables return inconsistent error for UPDATE
|
||||
--echo #
|
||||
|
||||
CREATE TABLE numbers
|
||||
ENGINE=CONNECT,
|
||||
TABLE_TYPE=VIR,
|
||||
BLOCK_SIZE=3;
|
||||
|
||||
--error ER_GET_ERRMSG
|
||||
TRUNCATE TABLE numbers;
|
||||
--error ER_GET_ERRMSG
|
||||
DELETE FROM numbers WHERE n = 1;
|
||||
--error ER_GET_ERRMSG
|
||||
UPDATE numbers SET n = 10 WHERE n = 1;
|
||||
DROP TABLE numbers;
|
||||
|
|
Loading…
Reference in a new issue