|
20 | 20 | use ErrorException; |
21 | 21 | use stdClass; |
22 | 22 |
|
23 | | -defined('OCI_COMMIT_ON_SUCCESS') || define('OCI_COMMIT_ON_SUCCESS', 32); |
24 | | - |
25 | 23 | /** |
26 | 24 | * Connection for OCI8 |
27 | 25 | * |
@@ -157,22 +155,6 @@ public function connect(bool $persistent = false) |
157 | 155 | : $func($this->username, $this->password, $this->DSN, $this->charset); |
158 | 156 | } |
159 | 157 |
|
160 | | - public function initialize() |
161 | | - { |
162 | | - parent::initialize(); |
163 | | - |
164 | | - if ($this->connID) { |
165 | | - $this->simpleQuery("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'"); |
166 | | - $this->simpleQuery("ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS'"); |
167 | | - $this->simpleQuery("ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS'"); |
168 | | - } |
169 | | - } |
170 | | - |
171 | | - /** |
172 | | - * Close the database connection. |
173 | | - * |
174 | | - * @return void |
175 | | - */ |
176 | 158 | protected function _close() |
177 | 159 | { |
178 | 160 | if (is_resource($this->cursorId)) { |
@@ -282,7 +264,7 @@ public function parseInsertTableName(string $sql): string |
282 | 264 | return ''; |
283 | 265 | } |
284 | 266 |
|
285 | | - preg_match('/(?is)\b(?:into)\s+(?:\"?\w+\"?\.)?(\"?\w+\"?)/', $commentStrippedSql, $match); |
| 267 | + preg_match('/(?is)\b(?:into)\s+("?\w+"?)/', $commentStrippedSql, $match); |
286 | 268 | $tableName = $match[1] ?? ''; |
287 | 269 |
|
288 | 270 | return str_starts_with($tableName, '"') ? trim($tableName, '"') : strtoupper($tableName); |
@@ -422,7 +404,7 @@ protected function _indexData(string $table): array |
422 | 404 | $retVal[$row->INDEX_NAME] = new stdClass(); |
423 | 405 | $retVal[$row->INDEX_NAME]->name = $row->INDEX_NAME; |
424 | 406 | $retVal[$row->INDEX_NAME]->fields = [$row->COLUMN_NAME]; |
425 | | - $retVal[$row->INDEX_NAME]->type = $constraintTypes[$row->CONSTRAINT_TYPE ?? ''] ?? 'INDEX'; |
| 407 | + $retVal[$row->INDEX_NAME]->type = $constraintTypes[$row->CONSTRAINT_TYPE] ?? 'INDEX'; |
426 | 408 | } |
427 | 409 |
|
428 | 410 | return $retVal; |
@@ -638,7 +620,7 @@ public function insertID(): int |
638 | 620 | } |
639 | 621 |
|
640 | 622 | $primaryColumnName = $this->protectIdentifiers($index->fields[0], false, false); |
641 | | - $primaryColumnType = $columnTypeList[$primaryColumnName] ?? $columnTypeList[strtoupper($primaryColumnName)] ?? null; |
| 623 | + $primaryColumnType = $columnTypeList[$primaryColumnName]; |
642 | 624 |
|
643 | 625 | if ($primaryColumnType !== 'NUMBER') { |
644 | 626 | $primaryColumnName = ''; |
|
0 commit comments