|
|
@@ -678,9 +678,9 @@ EOF_STRUCT_MYSQL;
|
|
|
} catch (Exception $e) {
|
|
|
DBG::log($e);
|
|
|
$dbType = $this->getType();
|
|
|
- $duplicateRegexp = "/SQLSTATE\[23000\]\: Integrity constraint violation: 1062 Duplicate entry '([0-9]+)' for key '(.*)'/";
|
|
|
- if ('mysql' == $dbType && false !== preg_match_all($duplicateRegexp, $e->getMessage(), $matches)) {
|
|
|
- DBG::nicePrint($matches, '$matches duplicate test');
|
|
|
+ $duplicateRegexp = "/^SQLSTATE\[23000\]\: Integrity constraint violation: 1062 Duplicate entry '([0-9]+)' for key '(.*)'/";
|
|
|
+ if ('mysql' == $dbType && preg_match_all($duplicateRegexp, $e->getMessage(), $matches) > 0) {
|
|
|
+ DBG::log(['matches'=>$matches,'msg'=>$e->getMessage(),'regex'=>$duplicateRegexp], 'array', '$matches duplicate test');
|
|
|
throw new MysqlDuplicateEntryException("Duplicate entry '{$matches[1][0]}'", 1062, null, $matches[1][0], $matches[2][0]);
|
|
|
} else {
|
|
|
throw $e;
|