@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $globalSql = $this->synchronizer->getCreateSchema($global); |
78 | 78 | if ($globalSql) { |
79 | 79 | $sql[] = "-- Create Root Federation\n" . |
80 | - "USE FEDERATION ROOT WITH RESET;"; |
|
80 | + "USE FEDERATION ROOT WITH RESET;"; |
|
81 | 81 | $sql = array_merge($sql, $globalSql); |
82 | 82 | } |
83 | 83 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $federationSql = $this->synchronizer->getDropAllSchema(); |
159 | 159 | if ($federationSql) { |
160 | 160 | $sql[] = "-- Work on Federation ID " . $shard['id'] . "\n" . |
161 | - "USE FEDERATION " . $this->shardManager->getFederationName() . " (" . $this->shardManager->getDistributionKey() . " = " . $shard['rangeLow'].") WITH RESET, FILTERING = OFF;"; |
|
161 | + "USE FEDERATION " . $this->shardManager->getFederationName() . " (" . $this->shardManager->getDistributionKey() . " = " . $shard['rangeLow'].") WITH RESET, FILTERING = OFF;"; |
|
162 | 162 | $sql = array_merge($sql, $federationSql); |
163 | 163 | } |
164 | 164 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $federationSql = $operation($this->synchronizer, $federation); |
254 | 254 | if ($federationSql) { |
255 | 255 | $sql[] = "-- Work on Federation ID " . $shard['id'] . "\n" . |
256 | - "USE FEDERATION " . $this->shardManager->getFederationName() . " (" . $this->shardManager->getDistributionKey() . " = " . $shard['rangeLow'].") WITH RESET, FILTERING = OFF;"; |
|
256 | + "USE FEDERATION " . $this->shardManager->getFederationName() . " (" . $this->shardManager->getDistributionKey() . " = " . $shard['rangeLow'].") WITH RESET, FILTERING = OFF;"; |
|
257 | 257 | $sql = array_merge($sql, $federationSql); |
258 | 258 | } |
259 | 259 | } |
@@ -294,6 +294,6 @@ discard block |
||
294 | 294 | $federationTypeSql = $federationType->getSQLDeclaration([], $this->conn->getDatabasePlatform()); |
295 | 295 | |
296 | 296 | return "--Create Federation\n" . |
297 | - "CREATE FEDERATION " . $this->shardManager->getFederationName() . " (" . $this->shardManager->getDistributionKey() . " " . $federationTypeSql ." RANGE)"; |
|
297 | + "CREATE FEDERATION " . $this->shardManager->getFederationName() . " (" . $this->shardManager->getDistributionKey() . " " . $federationTypeSql ." RANGE)"; |
|
298 | 298 | } |
299 | 299 | } |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | return $this->conn->fetchAll($sql); |
199 | 199 | } |
200 | 200 | |
201 | - /** |
|
202 | - * {@inheritDoc} |
|
203 | - */ |
|
201 | + /** |
|
202 | + * {@inheritDoc} |
|
203 | + */ |
|
204 | 204 | public function queryAll($sql, array $params = [], array $types = []) |
205 | 205 | { |
206 | 206 | $shards = $this->getShards(); |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | $type = Type::getType($this->distributionType); |
240 | 240 | |
241 | 241 | $sql = "ALTER FEDERATION " . $this->getFederationName() . " " . |
242 | - "SPLIT AT (" . $this->getDistributionKey() . " = " . |
|
243 | - $this->conn->quote($splitDistributionValue, $type->getBindingType()) . ")"; |
|
242 | + "SPLIT AT (" . $this->getDistributionKey() . " = " . |
|
243 | + $this->conn->quote($splitDistributionValue, $type->getBindingType()) . ")"; |
|
244 | 244 | $this->conn->exec($sql); |
245 | 245 | } |
246 | 246 | } |
@@ -143,8 +143,8 @@ |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | $sql = "UPDATE " . $this->generatorTableName . " ". |
146 | - "SET sequence_value = sequence_value + sequence_increment_by " . |
|
147 | - "WHERE sequence_name = ? AND sequence_value = ?"; |
|
146 | + "SET sequence_value = sequence_value + sequence_increment_by " . |
|
147 | + "WHERE sequence_name = ? AND sequence_value = ?"; |
|
148 | 148 | $rows = $this->conn->executeUpdate($sql, [$sequenceName, $row['sequence_value']]); |
149 | 149 | |
150 | 150 | if ($rows != 1) { |
@@ -41,11 +41,11 @@ |
||
41 | 41 | if ($params['host'] !== 'localhost' && $params['host'] != '127.0.0.1') { |
42 | 42 | // if the host isn't localhost, use extended connection params |
43 | 43 | $params['dbname'] = 'DRIVER={IBM DB2 ODBC DRIVER}' . |
44 | - ';DATABASE=' . $params['dbname'] . |
|
45 | - ';HOSTNAME=' . $params['host'] . |
|
46 | - ';PROTOCOL=' . $params['protocol'] . |
|
47 | - ';UID=' . $username . |
|
48 | - ';PWD=' . $password .';'; |
|
44 | + ';DATABASE=' . $params['dbname'] . |
|
45 | + ';HOSTNAME=' . $params['host'] . |
|
46 | + ';PROTOCOL=' . $params['protocol'] . |
|
47 | + ';UID=' . $username . |
|
48 | + ';PWD=' . $password .';'; |
|
49 | 49 | if (isset($params['port'])) { |
50 | 50 | $params['dbname'] .= 'PORT=' . $params['port']; |
51 | 51 | } |
@@ -145,8 +145,8 @@ |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | return '(DESCRIPTION=' . |
148 | - '(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params['host'] . ')(PORT=' . $params['port'] . '))' . |
|
149 | - '(CONNECT_DATA=(' . $service . ')' . $instance . $pooled . '))'; |
|
148 | + '(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params['host'] . ')(PORT=' . $params['port'] . '))' . |
|
149 | + '(CONNECT_DATA=(' . $service . ')' . $instance . $pooled . '))'; |
|
150 | 150 | |
151 | 151 | } |
152 | 152 |
@@ -413,7 +413,7 @@ |
||
413 | 413 | } |
414 | 414 | |
415 | 415 | return 'ALTER TABLE ' . $table . |
416 | - ' ADD ' . $this->getTableConstraintDeclarationSQL($constraint, $constraint->getQuotedName($this)); |
|
416 | + ' ADD ' . $this->getTableConstraintDeclarationSQL($constraint, $constraint->getQuotedName($this)); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | /** |
@@ -350,9 +350,9 @@ discard block |
||
350 | 350 | } |
351 | 351 | |
352 | 352 | return "SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT, IS_NULLABLE, IS_AUTO_INCREMENT, CHARACTER_MAXIMUM_LENGTH, COLUMN_DEFAULT," . |
353 | - " NUMERIC_PRECISION, NUMERIC_SCALE, COLLATION_NAME" . |
|
354 | - " FROM DATA_DICTIONARY.COLUMNS" . |
|
355 | - " WHERE TABLE_SCHEMA=" . $database . " AND TABLE_NAME = '" . $table . "'"; |
|
353 | + " NUMERIC_PRECISION, NUMERIC_SCALE, COLLATION_NAME" . |
|
354 | + " FROM DATA_DICTIONARY.COLUMNS" . |
|
355 | + " WHERE TABLE_SCHEMA=" . $database . " AND TABLE_NAME = '" . $table . "'"; |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
@@ -367,8 +367,8 @@ discard block |
||
367 | 367 | } |
368 | 368 | |
369 | 369 | return "SELECT CONSTRAINT_NAME, CONSTRAINT_COLUMNS, REFERENCED_TABLE_NAME, REFERENCED_TABLE_COLUMNS, UPDATE_RULE, DELETE_RULE" . |
370 | - " FROM DATA_DICTIONARY.FOREIGN_KEYS" . |
|
371 | - " WHERE CONSTRAINT_SCHEMA=" . $database . " AND CONSTRAINT_TABLE='" . $table . "'"; |
|
370 | + " FROM DATA_DICTIONARY.FOREIGN_KEYS" . |
|
371 | + " WHERE CONSTRAINT_SCHEMA=" . $database . " AND CONSTRAINT_TABLE='" . $table . "'"; |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | /** |
@@ -383,8 +383,8 @@ discard block |
||
383 | 383 | } |
384 | 384 | |
385 | 385 | return "SELECT INDEX_NAME AS 'key_name', COLUMN_NAME AS 'column_name', IS_USED_IN_PRIMARY AS 'primary', IS_UNIQUE=0 AS 'non_unique'" . |
386 | - " FROM DATA_DICTIONARY.INDEX_PARTS" . |
|
387 | - " WHERE TABLE_SCHEMA=" . $database . " AND TABLE_NAME='" . $table . "'"; |
|
386 | + " FROM DATA_DICTIONARY.INDEX_PARTS" . |
|
387 | + " WHERE TABLE_SCHEMA=" . $database . " AND TABLE_NAME='" . $table . "'"; |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | /** |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | } |
602 | 602 | } |
603 | 603 | } elseif (is_bool($item) || is_numeric($item)) { |
604 | - $item = ($item) ? 'true' : 'false'; |
|
604 | + $item = ($item) ? 'true' : 'false'; |
|
605 | 605 | } |
606 | 606 | |
607 | 607 | return $item; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function getAlterSequenceSQL(Sequence $sequence) |
42 | 42 | { |
43 | 43 | return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . |
44 | - ' INCREMENT BY ' . $sequence->getAllocationSize(); |
|
44 | + ' INCREMENT BY ' . $sequence->getAllocationSize(); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | public function getCreateSequenceSQL(Sequence $sequence) |
51 | 51 | { |
52 | 52 | return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . |
53 | - ' START WITH ' . $sequence->getInitialValue() . |
|
54 | - ' INCREMENT BY ' . $sequence->getAllocationSize() . |
|
55 | - ' MINVALUE ' . $sequence->getInitialValue(); |
|
53 | + ' START WITH ' . $sequence->getInitialValue() . |
|
54 | + ' INCREMENT BY ' . $sequence->getAllocationSize() . |
|
55 | + ' MINVALUE ' . $sequence->getInitialValue(); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | $table = $this->quoteStringLiteral($table); |
177 | 177 | |
178 | 178 | return "SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, ". |
179 | - "SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, ". |
|
180 | - "CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, " . |
|
181 | - "NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment " . |
|
182 | - "FROM information_schema.STATISTICS WHERE TABLE_NAME = " . $table . " AND TABLE_SCHEMA = " . $currentDatabase; |
|
179 | + "SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, ". |
|
180 | + "CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, " . |
|
181 | + "NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment " . |
|
182 | + "FROM information_schema.STATISTICS WHERE TABLE_NAME = " . $table . " AND TABLE_SCHEMA = " . $currentDatabase; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | return 'SHOW INDEX FROM ' . $table; |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | } |
208 | 208 | |
209 | 209 | $sql = "SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, ". |
210 | - "k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ ". |
|
211 | - "FROM information_schema.key_column_usage k /*!50116 ". |
|
212 | - "INNER JOIN information_schema.referential_constraints c ON ". |
|
213 | - " c.constraint_name = k.constraint_name AND ". |
|
214 | - " c.table_name = $table */ WHERE k.table_name = $table"; |
|
210 | + "k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ ". |
|
211 | + "FROM information_schema.key_column_usage k /*!50116 ". |
|
212 | + "INNER JOIN information_schema.referential_constraints c ON ". |
|
213 | + " c.constraint_name = k.constraint_name AND ". |
|
214 | + " c.table_name = $table */ WHERE k.table_name = $table"; |
|
215 | 215 | |
216 | 216 | $databaseNameSql = $database ?? 'DATABASE()'; |
217 | 217 | |
@@ -397,9 +397,9 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | return "SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, ". |
400 | - "COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, " . |
|
401 | - "CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation ". |
|
402 | - "FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = " . $database . " AND TABLE_NAME = " . $table; |
|
400 | + "COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, " . |
|
401 | + "CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation ". |
|
402 | + "FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = " . $database . " AND TABLE_NAME = " . $table; |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | /** |