@@ -488,7 +488,7 @@ ODBC_TEST(test_need_long_data_len)
488
488
489
489
/* https://jira.mariadb.org/browse/ODBC-61
490
490
Request of SQL_FILE_USAGE info crashes connector */
491
- ODBC_TEST (t_odbc61 )
491
+ ODBC_TEST (odbc61 )
492
492
{
493
493
SQLUSMALLINT info = 0xef ;
494
494
@@ -502,7 +502,7 @@ ODBC_TEST(t_odbc61)
502
502
Bug ODBC-84 and ODBC-62. For ODBC-84 we only tested, that SQLGetTypeInfo returns something for WCHAR types
503
503
For ODBC-62 we need to check CREATE_PARAMS
504
504
*/
505
- ODBC_TEST (t_odbc84_62 )
505
+ ODBC_TEST (odbc84_62 )
506
506
{
507
507
SQLHANDLE henv1 ;
508
508
SQLHANDLE Connection1 ;
@@ -637,7 +637,7 @@ ODBC_TEST(t_odbc84_62)
637
637
}
638
638
639
639
/* Test for part of problems causing ODBC-71. Other part is tested in desc.c:t_set_explicit_copy*/
640
- ODBC_TEST (t_odbc71 )
640
+ ODBC_TEST (odbc71 )
641
641
{
642
642
SQLINTEGER Info ;
643
643
@@ -662,7 +662,7 @@ ODBC_TEST(t_odbc71)
662
662
/* ODBC-123 Test for SQL_CATALOG_LOCATION info type. The connector incorrectly wrote to the buffer SQLUINTEGER,
663
663
while it has to be SQLUSMALLINT,
664
664
Also testing SQL_GROUP_BY, which has the same problem */
665
- ODBC_TEST (t_odbc123 )
665
+ ODBC_TEST (odbc123 )
666
666
{
667
667
SQLUSMALLINT Info ;
668
668
@@ -676,6 +676,43 @@ ODBC_TEST(t_odbc123)
676
676
}
677
677
678
678
679
+ /* ODBC-109 It's not clear atm if that is the reason behind the report, but it was found during work on this bug.
680
+ For the info type SQL_SCHEMA_TERM/SQL_OWNER_TERM the connector returned wrong length. Or more exactly - did not
681
+ write anything into application's length buffer */
682
+ ODBC_TEST (odbc109 )
683
+ {
684
+ SQLCHAR tn ;
685
+ SQLSMALLINT StrLen ;
686
+ SQLHANDLE henv1 ;
687
+ SQLHANDLE Connection1 ;
688
+ SQLCHAR conn [512 ];
689
+
690
+ /* SQL_OWNER_TERM is the same as SQL_SCHEMA_TERM */
691
+ CHECK_DBC_RC (Connection , SQLGetInfo (Connection , SQL_OWNER_TERM , NULL , 0 , & StrLen ));
692
+ is_num (StrLen , 0 );
693
+ CHECK_DBC_RC (Connection , SQLGetInfo (Connection , SQL_OWNER_TERM , & tn , 1 , NULL ));
694
+ is_num (tn , 0 );
695
+
696
+ /* odbc 2 */
697
+ sprintf ((char * )conn , "DRIVER=%s;SERVER=%s;UID=%s;PASSWORD=%s;PORT=%d" ,
698
+ my_drivername , my_servername , my_uid , my_pwd , my_port );
699
+
700
+ CHECK_ENV_RC (henv1 , SQLAllocHandle (SQL_HANDLE_ENV , SQL_NULL_HANDLE , & henv1 ));
701
+ CHECK_ENV_RC (henv1 , SQLSetEnvAttr (henv1 , SQL_ATTR_ODBC_VERSION ,
702
+ (SQLPOINTER )SQL_OV_ODBC2 , SQL_IS_INTEGER ));
703
+ CHECK_ENV_RC (henv1 , SQLAllocHandle (SQL_HANDLE_DBC , henv1 , & Connection1 ));
704
+ CHECK_DBC_RC (Connection1 , SQLDriverConnect (Connection1 , NULL , conn , (SQLSMALLINT )strlen (conn ), NULL , 0 ,
705
+ NULL , SQL_DRIVER_NOPROMPT ));
706
+
707
+ CHECK_DBC_RC (Connection1 , SQLGetInfo (Connection1 , SQL_OWNER_TERM , NULL , 0 , & StrLen ));
708
+ is_num (StrLen , 0 );
709
+ CHECK_DBC_RC (Connection1 , SQLGetInfo (Connection1 , SQL_OWNER_TERM , & tn , 1 , NULL ));
710
+ is_num (tn , 0 );
711
+
712
+ return OK ;
713
+ }
714
+
715
+
679
716
MA_ODBC_TESTS my_tests []=
680
717
{
681
718
{ t_gettypeinfo , "t_gettypeinfo" , NORMAL },
@@ -692,10 +729,11 @@ MA_ODBC_TESTS my_tests[]=
692
729
{ t_bug11749093 , "t_bug11749093" , NORMAL },
693
730
{ bug_odbc15 , "odbc15" , NORMAL },
694
731
{ test_need_long_data_len , "test_need_long_data_len" , NORMAL },
695
- { t_odbc61 , "odbc61_SQL_FILE_USAGE" , NORMAL },
696
- { t_odbc84_62 , "odbc84_WCHAR_types_odbc62_CREATE_PARAMS" , NORMAL },
697
- { t_odbc71 , "odbc71_some_odbc2_types" , NORMAL },
698
- { t_odbc123 , "odbc123_catalog_start" , NORMAL },
732
+ { odbc61 , "odbc61_SQL_FILE_USAGE" , NORMAL },
733
+ { odbc84_62 , "odbc84_WCHAR_types_odbc62_CREATE_PARAMS" , NORMAL },
734
+ { odbc71 , "odbc71_some_odbc2_types" , NORMAL },
735
+ { odbc123 , "odbc123_catalog_start" , NORMAL },
736
+ { odbc109 , "odbc109_shema_owner_term" , NORMAL },
699
737
{ NULL , NULL }
700
738
};
701
739
0 commit comments