Avoid deprecated SQLAllocStmt/SQLFreeStmt in regression tests.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 24 Mar 2014 06:49:26 +0000 (08:49 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 24 Mar 2014 06:49:26 +0000 (08:49 +0200)
The deprecated functions have a test case of their own.

Michael Paquier

23 files changed:
test/src/alter-test.c
test/src/arraybinding-test.c
test/src/bindcol-test.c
test/src/boolsaschar-test.c
test/src/catalogfunctions-test.c
test/src/commands-test.c
test/src/common.c
test/src/cte-test.c
test/src/cursors-test.c
test/src/cvtnulldate-test.c
test/src/dataatexecution-test.c
test/src/deprecated-test.c
test/src/getresult-test.c
test/src/insertreturning-test.c
test/src/lfconversion-test.c
test/src/multistmt-test.c
test/src/notice-test.c
test/src/params-test.c
test/src/positioned-update-test.c
test/src/prepare-test.c
test/src/quotes-test.c
test/src/select-test.c
test/src/stmthandles-test.c

index b21a0b9951adea5de1776c95d0b0fa32ca0c0699..83991b8b872490bd8e4c39588cd13d41a805a2da 100644 (file)
@@ -10,7 +10,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 9fcbe9743fc83934f95efe2986f6d06708ffcd8b..4db3b9bb6a0c8b5eedd381f2e698543659c95301 100644 (file)
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
    rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    CHECK_STMT_RESULT(rc, "SQLFreeHandle failed", hstmt);
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
    rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    CHECK_STMT_RESULT(rc, "SQLFreeHandle failed", hstmt);
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 0c0b42d1d710430719e1860e505c988c3deb9846..7220dcc6e67d595226ec39dc275dd151334a3a07 100644 (file)
@@ -26,7 +26,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index cd660f4f3358d0faf960b6280dfe127ceddcc795..90c646e977666b791f5bc9247b91aa404fe407fb 100644 (file)
@@ -16,7 +16,7 @@ int main(int argc, char **argv)
    /* BoolsAsChar is the default, but just in case.. */
    test_connect_ext("BoolsAsChar=1;UseServerSidePrepare=1");
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 3d2d9ac3bec1addce19821e70704d0b7da08f826..f45e7bf3250ad3093478ccccad15c246806993d8 100644 (file)
@@ -33,7 +33,7 @@ main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index f0f11cab7bd55082ce9941ee2d98983b41e29da8..96ca7ad2f1647e60e3891d50cb2fdd699babe976 100644 (file)
@@ -14,7 +14,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 904b10d9aa09f6fd104f3d3c0a5314ec49c1d3d3..595bc42fda5d21eda8b403d2820624a998732c66 100644 (file)
@@ -71,7 +71,7 @@ test_disconnect(void)
    rc = SQLFreeHandle(SQL_HANDLE_DBC, conn);
    if (!SQL_SUCCEEDED(rc))
    {
-       print_diag("SQLFreeConnect failed", SQL_HANDLE_DBC, conn);
+       print_diag("SQLFreeHandle failed", SQL_HANDLE_DBC, conn);
        exit(1);
    }
    conn = NULL;
@@ -79,7 +79,7 @@ test_disconnect(void)
    rc = SQLFreeHandle(SQL_HANDLE_ENV, env);
    if (!SQL_SUCCEEDED(rc))
    {
-       print_diag("SQLFreeEnv failed", SQL_HANDLE_ENV, env);
+       print_diag("SQLFreeHandle failed", SQL_HANDLE_ENV, env);
        exit(1);
    }
    env = NULL;
index be740e1f20031a7bacfe38cea9affa86b942f203..56603741175357e6a97722cfe00d5c1b00149f01 100644 (file)
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
     */
    test_connect_ext("UseDeclareFetch=0");
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
    /**** And then the same with UseDeclareFetch = 1 ****/
    test_connect_ext("UseDeclareFetch=1;Fetch=1");
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 201595d197ab5fcb72a5c3561a81425e26f4c2da..3fde5cb08e6c2852ecb610c3739a9e8b2a0ab7d2 100644 (file)
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 3e1e178353121f985e3c56a72522c03487d0e6f0..56c4af49a67a816b1a6aad2ecc1310083e58f55d 100644 (file)
@@ -15,7 +15,7 @@ int main(int argc, char **argv)
 
    test_connect_ext("AB=0x08;UseServerSidePrepare=1");
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index bd3ee13a49a128610cafedae3a7777636fd08fd2..36627b0b29ecdd086966f3ec728495ed5bfab329 100644 (file)
@@ -23,7 +23,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 923ac463c3f6d74acd211e0322b804fcf64c5f2b..0883434ae220da3befb42be69c318230e70a0547 100644 (file)
@@ -307,7 +307,7 @@ main(int argc, char **argv)
 
    /* Grab new connection and handle for the next tests */
    test_connect();
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 5967a5d3d341026c93c8da1d202042af816f176a..2eeef7dbb7be7cf253c5917f530dd2fee0e6c7cf 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index e0f8ef588f0cbf366ea35fd8ba79a38662c75611..ef839e7f1ef932f204fab6f9d7c619d358286e05 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -75,10 +75,10 @@ int main(int argc, char **argv)
        CHECK_STMT_RESULT(rc, "SQLFreeStmt failed", hstmt);
    }
 
-   rc = SQLFreeStmt(hstmt, SQL_DROP);
+   rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
-       print_diag("SQLFreeStmt failed", SQL_HANDLE_STMT, hstmt);
+       print_diag("SQLFreeHandle failed", SQL_HANDLE_STMT, hstmt);
        exit(1);
    }
 
index 20f4b7fc672ff82ee342d75a0f81bd1b29df48b3..12893be3b8cd451562ded93879cbf6487b33d119 100644 (file)
@@ -23,7 +23,7 @@ int main(int argc, char **argv)
    /* Enable LF -> CR+LF conversion */
    test_connect_ext("CX=1");
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index cd55b669298e7f07a55cd3ad898f394637b34ed6..f008050af24b4ce309ad264259ebda0525897441 100644 (file)
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 777c7a8c2ddc6f2e0000137e989244f29ce57175..c4274f05d27685d9bac509f69690cc030393986f 100644 (file)
@@ -11,7 +11,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
    if (rc == SQL_SUCCESS_WITH_INFO)
        print_diag("got SUCCESS_WITH_INFO", SQL_HANDLE_STMT, hstmt);
 
-   rc = SQLFreeStmt(hstmt, SQL_DROP);
+   rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("SQLFreeStmt failed", SQL_HANDLE_STMT, hstmt);
index eccd6263896eb069c365b6e81cf11c4c631d0407..df76d55f00b27dc2c0a29b83f757190b7a214127 100644 (file)
@@ -19,7 +19,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 8b31233d41cd951edf534eff242c3af979cc8157..c66123f67182c8d3bfff4bb67874c3165ce6f8cc 100644 (file)
@@ -16,7 +16,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 0033caf7daeddae4f7d4cc8f86907d8b703ea7db..f4e05ffbb9f1d8e32ada78ee51fdf0fc1e9f2cec 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -231,7 +231,7 @@ int main(int argc, char **argv)
    /* Fetch result */
    print_result(hstmt);
 
-   rc = SQLFreeStmt(hstmt, SQL_DROP);
+   rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("SQLFreeStmt failed", SQL_HANDLE_STMT, hstmt);
index 6c3238ce5b15e35cc557d8e55512c2c6a18f8748..0157d148dcf45b2af93629b4afd417eb70e54db7 100644 (file)
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index e4f091213924a0a3922740da1286bd692b1dceb1..adeb80eff3aa5dceffda953dc26b7976a19759c0 100644 (file)
@@ -14,7 +14,7 @@ int main(int argc, char **argv)
 
    test_connect();
 
-   rc = SQLAllocStmt(conn, &hstmt);
+   rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
    if (!SQL_SUCCEEDED(rc))
    {
        print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
index 3f8db14a6880512b49df5fc3b31f38a5f447b579..15b378ef2b37b556efc3ce32cc86e35e24670b85 100644 (file)
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
    /* Allocate a lot of stmt handles */
    for (i = 0; i < NUM_STMT_HANDLES; i++)
    {
-       rc = SQLAllocStmt(conn, &hstmt[i]);
+       rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt[i]);
        if (!SQL_SUCCEEDED(rc))
        {
            printf("failed to allocate stmt handle %d\n", i + 1);