Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Connector/ODBC 3.51 commit: r621 - trunk/test

From: <jwinstead(at)mysql.com>
Date: Tue Jul 31 2007 - 17:27:41 EDT


Modified:

   trunk/test/my_result.c
Log:
Fix test to handle that sometimes SQLColAttributes expects a SQLLEN, and sometimes a SQLINTEGER.

Modified: trunk/test/my_result.c


  • trunk/test/my_result.c 2007-07-31 21:04:48 UTC (rev 620) +++ trunk/test/my_result.c 2007-07-31 21:27:41 UTC (rev 621) @@ -1347,47 +1347,11 @@ }

-static int colattr(SQLHSTMT hstmt, SQLUSMALLINT cno, SQLUSMALLINT attribute,

  • SQLCHAR *sptr, SQLSMALLINT slen, SQLLEN nptr)
    -{
  • SQLCHAR lsptr[40];
  • SQLSMALLINT lslen;
  • SQLLEN lnptr;
    -
  • ok_stmt(hstmt, SQLFreeStmt(hstmt,SQL_CLOSE));
  • ok_sql(hstmt, "SELECT * FROM t_colattr");
    -
  • ok_stmt(hstmt, SQLColAttribute(hstmt, cno, attribute, lsptr, sizeof(lsptr),
  • &lslen, &lnptr));
  • if (sptr)
  • {
  • is_num(lslen, slen);
  • is_str(lsptr, sptr, lslen);
  • }
  • else
  • {
  • printf("lnptr = %lld\n", lnptr);
  • printf("nptr = %lld\n", nptr);
  • printf("equal = %d\n", nptr == lnptr);
  • printf("nequal = %d\n", nptr != lnptr);
  • /* is_num(lnptr, nptr); */
  • do {
  • if (lnptr != nptr) {
  • printf("# %s (%ld) != %ld in %s on line %d\n",
  • "lnptr", (long)lnptr, (long)nptr, __FILE__, __LINE__);
  • return FAIL;
  • }
  • } while (0);
  • }
    -
  • ok_stmt(hstmt, SQLFreeStmt(hstmt, SQL_CLOSE));
    -
  • return OK;
    -}
    -
    -
    DECLARE_TEST(t_colattributes) { + SQLLEN count; + SQLINTEGER isauto; + ok_sql(hstmt, "DROP TABLE IF EXISTS t_colattr");

   ok_sql(hstmt,
@@ -1448,11 +1412,17 @@

          "en ENUM('v1','v2'),"
          "st SET('1','2','3'))");
 
  • if (colattr(hstmt, 1, SQL_COLUMN_COUNT, NULL, 0, 55) != OK)
  • return FAIL;
  • if (colattr(hstmt, 1, SQL_COLUMN_AUTO_INCREMENT, NULL, 0, SQL_TRUE) != OK)
  • return FAIL; + ok_stmt(hstmt, SQLFreeStmt(hstmt,SQL_CLOSE)); + ok_sql(hstmt, "SELECT * FROM t_colattr");
+  ok_stmt(hstmt, SQLColAttribute(hstmt, 1, SQL_COLUMN_COUNT, NULL, 0, NULL,
+                                 &count));
+  is(count == 55);
+
+  ok_stmt(hstmt, SQLColAttribute(hstmt, 1, SQL_COLUMN_AUTO_INCREMENT, NULL, 0,
+                                 NULL, &isauto));
+  is_num(isauto, SQL_TRUE);
+

   ok_sql(hstmt, "DROP TABLE IF EXISTS t_colattr");  

   return OK;

--

MySQL Code Commits Mailing List
For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.com Received on Tue Jul 31 17:27:52 2007

Do you need help?X

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:20:21 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library