@@ -375,9 +375,10 @@ public function getListDatabasesSQL()
375375 public function getListSequencesSQL ($ database )
376376 {
377377 $ database = $ this ->normalizeIdentifier ($ database );
378+ $ database = $ this ->quoteStringLiteral ($ database ->getName ());
378379
379380 return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences " .
380- "WHERE SEQUENCE_OWNER = ' " . $ database-> getName () . " ' " ;
381+ "WHERE SEQUENCE_OWNER = " . $ database ;
381382 }
382383
383384 /**
@@ -418,6 +419,7 @@ protected function _getCreateTableSQL($table, array $columns, array $options = a
418419 public function getListTableIndexesSQL ($ table , $ currentDatabase = null )
419420 {
420421 $ table = $ this ->normalizeIdentifier ($ table );
422+ $ table = $ this ->quoteStringLiteral ($ table ->getName ());
421423
422424 return "SELECT uind_col.index_name AS name,
423425 (
@@ -444,7 +446,7 @@ public function getListTableIndexesSQL($table, $currentDatabase = null)
444446 WHERE ucon.constraint_name = uind_col.index_name
445447 ) AS is_primary
446448 FROM user_ind_columns uind_col
447- WHERE uind_col.table_name = ' " . $ table-> getName () . "'
449+ WHERE uind_col.table_name = " . $ table . "
448450 ORDER BY uind_col.column_position ASC " ;
449451 }
450452
@@ -608,7 +610,8 @@ private function getAutoincrementIdentifierName(Identifier $table)
608610 */
609611 public function getListTableForeignKeysSQL ($ table )
610612 {
611- $ table = $ table = $ this ->normalizeIdentifier ($ table );
613+ $ table = $ this ->normalizeIdentifier ($ table );
614+ $ table = $ this ->quoteStringLiteral ($ table ->getName ());
612615
613616 return "SELECT alc.constraint_name,
614617 alc.DELETE_RULE,
@@ -630,7 +633,7 @@ public function getListTableForeignKeysSQL($table)
630633 JOIN user_constraints alc
631634 ON alc.constraint_name = cols.constraint_name
632635 AND alc.constraint_type = 'R'
633- AND alc.table_name = ' " . $ table-> getName () . "'
636+ AND alc.table_name = " . $ table . "
634637 ORDER BY cols.constraint_name ASC, cols.position ASC " ;
635638 }
636639
@@ -640,8 +643,9 @@ public function getListTableForeignKeysSQL($table)
640643 public function getListTableConstraintsSQL ($ table )
641644 {
642645 $ table = $ this ->normalizeIdentifier ($ table );
646+ $ table = $ this ->quoteStringLiteral ($ table ->getName ());
643647
644- return "SELECT * FROM user_constraints WHERE table_name = ' " . $ table-> getName () . " ' " ;
648+ return "SELECT * FROM user_constraints WHERE table_name = " . $ table ;
645649 }
646650
647651 /**
@@ -650,16 +654,18 @@ public function getListTableConstraintsSQL($table)
650654 public function getListTableColumnsSQL ($ table , $ database = null )
651655 {
652656 $ table = $ this ->normalizeIdentifier ($ table );
657+ $ table = $ this ->quoteStringLiteral ($ table ->getName ());
653658
654659 $ tabColumnsTableName = "user_tab_columns " ;
655660 $ colCommentsTableName = "user_col_comments " ;
656661 $ ownerCondition = '' ;
657662
658663 if (null !== $ database ) {
659664 $ database = $ this ->normalizeIdentifier ($ database );
665+ $ database = $ this ->quoteStringLiteral ($ database ->getName ());
660666 $ tabColumnsTableName = "all_tab_columns " ;
661667 $ colCommentsTableName = "all_col_comments " ;
662- $ ownerCondition = "AND c.owner = ' " . $ database-> getName () . " ' " ;
668+ $ ownerCondition = "AND c.owner = " . $ database ;
663669 }
664670
665671 return "SELECT c.*,
@@ -670,7 +676,7 @@ public function getListTableColumnsSQL($table, $database = null)
670676 AND d.COLUMN_NAME = c.COLUMN_NAME
671677 ) AS comments
672678 FROM $ tabColumnsTableName c
673- WHERE c.table_name = ' " . $ table-> getName () . "' $ ownerCondition
679+ WHERE c.table_name = " . $ table . " $ ownerCondition
674680 ORDER BY c.column_name " ;
675681 }
676682
@@ -1153,4 +1159,14 @@ public function getBlobTypeDeclarationSQL(array $field)
11531159 {
11541160 return 'BLOB ' ;
11551161 }
1162+
1163+ /**
1164+ * {@inheritdoc}
1165+ */
1166+ public function quoteStringLiteral ($ str )
1167+ {
1168+ $ str = str_replace ('\\' , '\\\\' , $ str ); // Oracle requires backslashes to be escaped aswell.
1169+
1170+ return parent ::quoteStringLiteral ($ str );
1171+ }
11561172}
0 commit comments