1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-27 21:01:50 +03:00

MCOL-129 INSERT/UPDATE strict mode support

This changes the warning for truncation to the correct MariaDB error
code (1264).

In addition it passes the strict mode up into the DML class to roll back
correctly.

It also sets the abort_on_warning flag for updates as this isn't set on
the rnd_init phase but is needed for strict mode to work.
This commit is contained in:
Andrew Hutchings
2016-11-04 14:06:00 +00:00
parent 059a158837
commit 4fc7fa12cd
5 changed files with 51 additions and 10 deletions

View File

@ -654,6 +654,14 @@ uint8_t WE_DMLCommandProc::processSingleInsert(messageqcpp::ByteStream& bs, std:
}
args.add(cols);
err = IDBErrorInfo::instance()->errorMsg(WARN_DATA_TRUNC,args);
// Strict mode enabled, so rollback on warning
if (insertPkg.get_isWarnToError())
{
string applName ("SingleInsert");
fWEWrapper.bulkRollback(tblOid,txnid.id,tableName.toString(),
applName, false, err);
BulkRollbackMgr::deleteMetaFile( tblOid );
}
}
return rc;
@ -1243,7 +1251,15 @@ End-Disable use of MetaFile for bulk rollback support
}
args.add(cols);
err = IDBErrorInfo::instance()->errorMsg(WARN_DATA_TRUNC,args);
// Strict mode enabled, so rollback on warning
if (insertPkg.get_isWarnToError())
{
string applName ("BatchInsert");
fWEWrapper.bulkRollback(tblOid,txnid.id,tableName.toString(),
applName, false, err);
BulkRollbackMgr::deleteMetaFile( tblOid );
}
}
//cout << "Batch insert return code " << rc << endl;
return rc;