@@ -706,6 +706,63 @@ public function testQuotedTableNames()
706
706
$ this ->assertEquals ($ createTriggerStatement , $ sql [3 ]);
707
707
}
708
708
709
+ /**
710
+ * @dataProvider getReturnsGetListTableColumnsSQL
711
+ * @group DBAL-831
712
+ */
713
+ public function testReturnsGetListTableColumnsSQL ($ database , $ expectedSql )
714
+ {
715
+ // note: this assertion is a bit strict, as it compares a full SQL string.
716
+ // Should this break in future, then please try to reduce the matching to substring matching while reworking
717
+ // the tests
718
+ $ this ->assertEquals ($ expectedSql , $ this ->_platform ->getListTableColumnsSQL ('"test" ' , $ database ));
719
+ }
720
+
721
+ public function getReturnsGetListTableColumnsSQL ()
722
+ {
723
+ return array (
724
+ array (
725
+ null ,
726
+ "SELECT c.*,
727
+ (
728
+ SELECT d.comments
729
+ FROM user_col_comments d
730
+ WHERE d.TABLE_NAME = c.TABLE_NAME
731
+ AND d.COLUMN_NAME = c.COLUMN_NAME
732
+ ) AS comments
733
+ FROM user_tab_columns c
734
+ WHERE c.table_name = 'test'
735
+ ORDER BY c.column_name "
736
+ ),
737
+ array (
738
+ '/ ' ,
739
+ "SELECT c.*,
740
+ (
741
+ SELECT d.comments
742
+ FROM user_col_comments d
743
+ WHERE d.TABLE_NAME = c.TABLE_NAME
744
+ AND d.COLUMN_NAME = c.COLUMN_NAME
745
+ ) AS comments
746
+ FROM user_tab_columns c
747
+ WHERE c.table_name = 'test'
748
+ ORDER BY c.column_name "
749
+ ),
750
+ array (
751
+ 'scott ' ,
752
+ "SELECT c.*,
753
+ (
754
+ SELECT d.comments
755
+ FROM all_col_comments d
756
+ WHERE d.TABLE_NAME = c.TABLE_NAME
757
+ AND d.COLUMN_NAME = c.COLUMN_NAME
758
+ ) AS comments
759
+ FROM all_tab_columns c
760
+ WHERE c.table_name = 'test' AND c.owner = 'SCOTT'
761
+ ORDER BY c.column_name "
762
+ ),
763
+ );
764
+ }
765
+
709
766
/**
710
767
* {@inheritdoc}
711
768
*/
0 commit comments