diff options
author | Mathew Heard <splitice@users.noreply.github.com> | 2022-02-08 08:57:24 +1100 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2022-06-10 11:36:59 +1000 |
commit | b59bc629c8cef1e3e07529007dca2948b812e8fb (patch) | |
tree | 28b95b38972ac32397ff835def37a44c922b60b7 /storage/connect/tabmysql.cpp | |
parent | ace2e0301e5d0f8c5acf02e671b6a1f3dd7fb374 (diff) | |
download | mariadb-git-b59bc629c8cef1e3e07529007dca2948b812e8fb.tar.gz |
MDEV-27766: connect engine; INSERT ignore option, was ignored
Test prior to this change:
CURRENT_TEST: connect.mysql
mysqltest: At line 485: query 'INSERT IGNORE INTO t3 VALUES (5),(10),(30)' failed: ER_GET_ERRMSG (1296): Got error 122 '(1062) Duplicate entry '10' for key 'PRIMARY' [INSERT INTO `t1` (`a`) VALUES (10)]' from CONNECT
So the ignore table option wasn't getting passed to the remove server.
Closes #2008
Diffstat (limited to 'storage/connect/tabmysql.cpp')
-rw-r--r-- | storage/connect/tabmysql.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 0d7cb6d50c4..975dc35d419 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -94,6 +94,7 @@ MYSQLDEF::MYSQLDEF(void) Isview = false; Bind = false; Delayed = false; + Ignored = false; //Xsrc = false; Huge = false; } // end of MYSQLDEF constructor @@ -321,6 +322,9 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int) Desc = "MySQL Table"; + Delayed = !!GetIntCatInfo("Delayed", 0); + Ignored = !!GetIntCatInfo("Ignored", 0); + if (stricmp(am, "MYPRX")) { // Normal case of specific MYSQL table url = GetStringCatInfo(g, "Connect", NULL); @@ -339,7 +343,6 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int) return true; Bind = !!GetIntCatInfo("Bind", 0); - Delayed = !!GetIntCatInfo("Delayed", 0); } else { // MYSQL access from a PROXY table TABLE_SHARE* s; @@ -425,6 +428,7 @@ TDBMYSQL::TDBMYSQL(PMYDEF tdp) : TDBEXT(tdp) Isview = tdp->Isview; Prep = tdp->Bind; Delayed = tdp->Delayed; + Ignored = tdp->Ignored; Myc.m_Use = tdp->Huge; } else { Host = NULL; @@ -440,6 +444,7 @@ TDBMYSQL::TDBMYSQL(PMYDEF tdp) : TDBEXT(tdp) Isview = false; Prep = false; Delayed = false; + Ignored = false; } // endif tdp Bind = NULL; @@ -466,6 +471,7 @@ TDBMYSQL::TDBMYSQL(PTDBMY tdbp) : TDBEXT(tdbp) Isview = tdbp->Isview; Prep = tdbp->Prep; Delayed = tdbp->Delayed; + Ignored = tdbp->Ignored; Bind = NULL; //Query = tdbp->Query; Fetched = tdbp->Fetched; @@ -623,11 +629,13 @@ bool TDBMYSQL::MakeInsert(PGLOBAL g) len += (strlen(TableName) + 40); Query = new(g) STRING(g, len); + Query->Set("INSERT "); if (Delayed) - Query->Set("INSERT DELAYED INTO "); - else - Query->Set("INSERT INTO "); + Query->Append("DELAYED "); + if (Ignored) + Query->Append("IGNORE "); + Query->Append("INTO "); Query->Append(tk); Query->Append(TableName); Query->Append("` ("); |