pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedMissing test for SQLGetConnectOption in deprecated function test
2+ messages / 2 participants
[nested] [flat]
* Missing test for SQLGetConnectOption in deprecated function test
@ 2014-03-24 04:32 Michael Paquier <michael.paquier@gmail.com>
2014-03-24 06:46 ` Re: Missing test for SQLGetConnectOption in deprecated function test Heikki Linnakangas <hlinnakangas@vmware.com>
0 siblings, 1 reply; 2+ messages in thread
From: Michael Paquier @ 2014-03-24 04:32 UTC (permalink / raw)
To: pgsql-odbc
Hi all,
I noticed that a test for SQLGetConnectOption was missing in the test
for deprecated functions in regressions, SQLGetConnectOption being
correctly done. Patch to correct that is attached.
Regards,
--
Michael
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Attachments:
20140324_pgodbc_setoption_fix.patch (text/plain, 2.1K) download
commit b79f5cd2602747100c21ccd98f012eaf63028032
Author: Michael Paquier <michael@otacoo.com>
Date: Mon Mar 24 13:20:18 2014 +0900
Add test for SQLGetConnectOption in deprecated section
diff --git a/test/expected/deprecated.out b/test/expected/deprecated.out
index 7e31d76..3c35c7c 100644
--- a/test/expected/deprecated.out
+++ b/test/expected/deprecated.out
@@ -3,6 +3,8 @@ Check for SQLAllocEnv
Check for SQLAllocConnect
Check for SQLAllocStmt
Check for SQLSetConnectOption
+Check for SQLGetConnectOption
+Access type is: read-write
Check for SQLError
Error check: ERROR: relation "table_not_here" does not exist;
Error while executing the query
diff --git a/test/src/deprecated-test.c b/test/src/deprecated-test.c
index 2fa7e0c..923ac46 100644
--- a/test/src/deprecated-test.c
+++ b/test/src/deprecated-test.c
@@ -11,7 +11,7 @@
void
print_cursor_type(SQLINTEGER cursor_type)
{
- printf( "Cursor type is: " ) ;
+ printf("Cursor type is: ");
if (cursor_type == SQL_CURSOR_FORWARD_ONLY)
printf("forward\n");
else if (cursor_type == SQL_CURSOR_STATIC)
@@ -25,6 +25,21 @@ print_cursor_type(SQLINTEGER cursor_type)
}
}
+void
+print_access_type(SQLINTEGER access_type)
+{
+ printf("Access type is: ");
+ if (access_type == SQL_MODE_READ_ONLY)
+ printf("read-only\n");
+ else if (access_type == SQL_MODE_READ_WRITE)
+ printf("read-write\n");
+ else
+ {
+ printf("Incorrect type of access\n");
+ exit(1);
+ }
+}
+
/* Array size for SQLParamOptions test */
#define ARRAY_SIZE 10
@@ -93,6 +108,7 @@ main(int argc, char **argv)
}
/*
+ * SQLSetConnectOption -> SQLSetConnectAttr
* SQLGetConnectOption -> SQLGetConnectAttr
* Test connection attribute.
*/
@@ -101,6 +117,12 @@ main(int argc, char **argv)
SQL_ATTR_ACCESS_MODE,
SQL_MODE_READ_WRITE);
CHECK_STMT_RESULT(rc, "SQLSetConnectOption failed", hstmt);
+ printf("Check for SQLGetConnectOption\n");
+ rc = SQLGetConnectOption(conn2,
+ SQL_ATTR_ACCESS_MODE,
+ &valint);
+ CHECK_STMT_RESULT(rc, "SQLGetConnectOption failed", hstmt);
+ print_access_type(valint);
/*
* SQLError -> SQLGetDiagRec
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Missing test for SQLGetConnectOption in deprecated function test
2014-03-24 04:32 Missing test for SQLGetConnectOption in deprecated function test Michael Paquier <michael.paquier@gmail.com>
@ 2014-03-24 06:46 ` Heikki Linnakangas <hlinnakangas@vmware.com>
0 siblings, 0 replies; 2+ messages in thread
From: Heikki Linnakangas @ 2014-03-24 06:46 UTC (permalink / raw)
To: Michael Paquier <michael.paquier@gmail.com>; +Cc: pgsql-odbc
On 03/24/2014 06:32 AM, Michael Paquier wrote:
> Hi all,
>
> I noticed that a test for SQLGetConnectOption was missing in the test
> for deprecated functions in regressions, SQLGetConnectOption being
> correctly done. Patch to correct that is attached.
Thanks, committed.
- Heikki
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2014-03-24 06:46 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-03-24 04:32 Missing test for SQLGetConnectOption in deprecated function test Michael Paquier <michael.paquier@gmail.com>
2014-03-24 06:46 ` Heikki Linnakangas <hlinnakangas@vmware.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox