Modified:
trunk/test/include/mytest3.h
trunk/test/test/mytest.c
trunk/test/test3/mytest3.c
trunk/test/test32/mytest32.c
Log:
More cleanups of incorrect data types in the test cases that cause failures
(mostly crashes) on 64-bit system (and possibly others).
Modified: trunk/test/include/mytest3.h
===================================================================
--- trunk/test/include/mytest3.h 2006-09-12 19:19:42 UTC (rev 99)
+++ trunk/test/include/mytest3.h 2006-09-12 23:16:48 UTC (rev 100)
@@ -19,14 +19,14 @@
#define __TMYODBC__TEST__H
#ifdef HAVE_CONFIG_H
- #include <myconf.h>
+# include <myconf.h>
#endif
/* Work around iODBC header bug on Mac OS X 10.3 */
#undef HAVE_CONFIG_H
#ifdef WIN32
- #include <windows.h>
-#endif
+# include <windows.h>
+#endif
/* STANDARD C HEADERS */
#include <stdio.h>
@@ -38,56 +38,52 @@
#include <sqlext.h>
/* for clock() */
-#include <time.h>
+#include <time.h>
#ifndef NULL
- #define NULL 0
+# define NULL 0
#endif
#ifndef ushort
- #define ushort unsigned short
+# define ushort unsigned short
#endif
#ifndef bool
- #define bool unsigned char
+# define bool unsigned char
#endif
#ifndef true
- #define true 1
+# define true 1
#endif
#ifndef false
- #define false 0
+# define false 0
#endif
#ifndef my_assert
- #define my_assert assert
+# define my_assert assert
#endif
#ifndef myassert
- #define myassert assert
+# define myassert assert
#endif
#ifndef Sleep
- #define Sleep _sleep
+# define Sleep _sleep
#endif
-#if DEBUG_LEVEL > 1
- #define printMessage printf
-#else
- #define printMessage
-#endif
+#define printMessage printf
#define MAX_NAME_LEN 255
#define MAX_COLUMNS 500
#define MAX_ROW_DATA_LEN 1000
#define MYSQL_NAME_LEN 64
-SQLCHAR *mydsn = "myodbc3";
-SQLCHAR *myuid = "root";
-SQLCHAR *mypwd = "";
-SQLCHAR *myserver = "localhost";
-SQLCHAR *mydb = "test";
+SQLCHAR *mydsn= "test";
+SQLCHAR *myuid= "root";
+SQLCHAR *mypwd= "";
+SQLCHAR *myserver= "localhost";
+SQLCHAR *mydb= "test";
SQLCHAR *test_db= "client_odbc_test";
int g_nCursor;
@@ -392,7 +388,8 @@
int my_print_non_format_result(SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLUINTEGER nRowCount=0, pcColDef;
+ SQLUINTEGER nRowCount=0;
+ SQLULEN pcColDef;
SQLCHAR szColName[MAX_NAME_LEN];
SQLCHAR szData[MAX_COLUMNS][MAX_ROW_DATA_LEN]={0};
SQLSMALLINT nIndex,ncol,pfSqlType, pcbScale, pfNullable;
@@ -444,7 +441,7 @@
SQLUINTEGER nRowCount;
SQLCHAR ColName[MAX_NAME_LEN+1];
SQLCHAR Data[MAX_ROW_DATA_LEN+1];
- SQLINTEGER size, pcbLength;
+ SQLLEN pcbLength, size;
SQLUSMALLINT nIndex;
SQLSMALLINT ncol;
@@ -521,26 +518,26 @@
/**
SQLExecDirect
*/
-SQLRETURN tmysql_exec(SQLHSTMT hstmt, SQLCHAR *sql_stmt)
+SQLRETURN tmysql_exec(SQLHSTMT hstmt, char *sql_stmt)
{
return(SQLExecDirect(hstmt,(SQLCHAR *)sql_stmt,SQL_NTS));
}
/**
SQLPrepare
*/
-SQLRETURN tmysql_prepare(SQLHSTMT hstmt, SQLCHAR *sql_stmt)
+SQLRETURN tmysql_prepare(SQLHSTMT hstmt, char *sql_stmt)
{
- return(SQLPrepare(hstmt,sql_stmt,SQL_NTS));
+ return(SQLPrepare(hstmt, (SQLCHAR *)sql_stmt, SQL_NTS));
}
/**
return integer data by fetching it
*/
SQLINTEGER my_fetch_int(SQLHSTMT hstmt, SQLUSMALLINT irow)
{
- SQLINTEGER nData;
+ long nData;
SQLGetData(hstmt,irow,SQL_INTEGER,&nData,0,NULL);
- printMessage( " my_fetch_int: %d\n",nData);
+ printMessage(" my_fetch_int: %ld\n", nData);
return(nData);
}
/**
@@ -548,10 +545,10 @@
*/
const char *my_fetch_str(SQLHSTMT hstmt, SQLCHAR *szData,SQLUSMALLINT irow)
{
- SQLINTEGER nLen=0;
+ SQLLEN nLen= 0;
SQLGetData(hstmt,irow,SQL_CHAR,szData,MAX_ROW_DATA_LEN+1,&nLen);
- printMessage( " my_fetch_str: %s(%d)\n",szData,nLen);
+ printMessage( " my_fetch_str: %s(%ld)\n",szData,nLen);
return((const char *)szData);
}
@@ -560,7 +557,7 @@
*/
bool server_is_mysql(SQLHDBC hdbc)
{
- SQLCHAR driver_name[MYSQL_NAME_LEN];
+ char driver_name[MYSQL_NAME_LEN];
SQLGetInfo(hdbc,SQL_DRIVER_NAME,driver_name,MYSQL_NAME_LEN,NULL);
Modified: trunk/test/test/mytest.c
===================================================================
--- trunk/test/test/mytest.c 2006-09-12 19:19:42 UTC (rev 99)
+++ trunk/test/test/mytest.c 2006-09-12 23:16:48 UTC (rev 100)
@@ -22,8 +22,7 @@
void t_basic(SQLHDBC hdbc,SQLHSTMT hstmt)
{
SQLRETURN rc;
- int nInData = 1;
- int nOutData, nRowCount=0;
+ long nInData= 1, nOutData, nRowCount= 0;
char szOutData[31]={0};
/* CREATE TABLE 'myodbc' */
@@ -101,9 +100,9 @@
void tmysql_setpos_del(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
- SQLCHAR szData[255]={0};
- SQLUINTEGER pcrow;
+ long nData = 500, nlen;
+ char szData[255]={0};
+ SQLLEN pcrow;
SQLUSMALLINT rgfRowStatus;
tmysql_exec(hstmt,"drop table tmysql_setpos1");
@@ -195,7 +194,8 @@
void tmysql_setpos_del1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -264,7 +264,8 @@
void tmysql_setpos_del_all(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -339,7 +340,8 @@
void tmysql_setpos_upd(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData = 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -419,7 +421,7 @@
rc = SQLExecDirect(hstmt,"DELETE FROM tmysql_setpos WHERE col2 = 'updated'",SQL_NTS);
mystmt(hstmt,rc);
- rc = SQLRowCount(hstmt,(SQLINTEGER *)&nlen);
+ rc = SQLRowCount(hstmt,&nlen);
mystmt(hstmt,rc);
printMessage("\n total rows affceted:%d",nlen);
my_assert(nlen == 1);
@@ -441,7 +443,8 @@
void tmysql_setpos_add(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -726,7 +729,7 @@
{
SQLRETURN rc;
int nodata;
- SQLINTEGER nlen, slen,tlen;
+ SQLLEN nlen, slen,tlen;
char szdata[20],sztdata[100];
SQLUSMALLINT rgfRowStatus[20];
@@ -816,8 +819,8 @@
void tmysql_bindparam(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- int nodata;
- long nlen, nidata = 200;
+ long nodata, nidata= 200;
+ SQLLEN nlen;
char szodata[20],szidata[20]="MySQL";
short pccol;
@@ -982,7 +985,7 @@
SQLCHAR sqlerr[30]="error";
SQLCHAR fixerr[30]= "fixerr";
SQLCHAR progerr[30]="progerr";
- SQLINTEGER pcbParamDef;
+ SQLULEN pcbParamDef;
SQLFreeStmt(hstmt,SQL_CLOSE);
rc = SQLPrepare(hstmt,"insert into sqlerr (TD, NODE, TAG, SQLNAME, SQL_ERR,
FIX_ERR, PROG_ERR)\
@@ -1626,7 +1629,8 @@
void tmysql_mtab_setpos_del(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1718,7 +1722,8 @@
void tmysql_setpos_pkdel(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1794,7 +1799,8 @@
void t_alias_setpos_pkdel(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1871,7 +1877,8 @@
void t_alias_setpos_del(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
SQLUSMALLINT rgfRowStatus;
@@ -1949,7 +1956,8 @@
void tmysql_setpos_pkdel1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -2025,7 +2033,8 @@
void tmysql_setpos_pkdel2(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -2100,7 +2109,7 @@
SQLHSTMT hstmt1;
SQLUINTEGER pcrow[4];
SQLUSMALLINT rgfRowStatus[6];
- SQLINTEGER nData = 555;
+ long nData = 555;
SQLCHAR szData[255] = "setpos-update";
printMessageHeader();
@@ -2237,7 +2246,8 @@
void tmysql_setpos_pkdel3(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -2307,7 +2317,8 @@
void t_mul_pkdel(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -2377,7 +2388,8 @@
void t_mul_pkdel1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -2446,7 +2458,7 @@
{
SQLRETURN rc;
SQLCHAR szData[255]={0};
- SQLINTEGER i;
+ long i;
printMessageHeader();
@@ -2593,7 +2605,7 @@
void t_max_con(HENV henv)
{
SQLRETURN rc;
- SQLINTEGER i;
+ long i;
SQLHDBC hdbc;
printMessageHeader();
@@ -3008,16 +3020,16 @@
rc = SQLFreeStmt(hstmt,SQL_CLOSE);
mystmt(hstmt,rc);
}
-void colattr(SQLHSTMT hstmt, SQLUSMALLINT cno,
+void colattr(SQLHSTMT hstmt, SQLUSMALLINT cno,
SQLUSMALLINT attribute, SQLCHAR *sptr,
- SQLSMALLINT slen,SQLINTEGER nptr)
-{
+ SQLSMALLINT slen, SQLINTEGER nptr)
+{
SQLRETURN rc =0;
SQLCHAR lsptr[40];
- SQLINTEGER lnptr;
+ SQLLEN lnptr;
SQLSMALLINT lslen;
- SQLFreeStmt(hstmt,SQL_CLOSE);
+ SQLFreeStmt(hstmt,SQL_CLOSE);
rc = SQLExecDirect(hstmt,"select * from t_colattr",SQL_NTS);
mystmt(hstmt,rc);
@@ -3027,17 +3039,17 @@
if (sptr)
{
- printMessage("%s(%d)\n",lsptr,lslen);
+ printMessage("%s(%ld)\n",lsptr,lslen);
myassert(!strcmp(lsptr,sptr)==0);
myassert(lslen == slen);
}
else
{
- printMessage("%d(%d)\n",lnptr,lslen);
+ printMessage("%ld(%d)\n",lnptr,lslen);
myassert(lnptr == nptr);
}
- SQLFreeStmt(hstmt,SQL_CLOSE);
+ SQLFreeStmt(hstmt,SQL_CLOSE);
}
void t_colatttribtes(SQLHDBC hdbc, SQLHSTMT hstmt)
@@ -3118,17 +3130,17 @@
rc = SQLFreeStmt(hstmt,SQL_CLOSE);
mystmt(hstmt,rc);
- colattr(hstmt,1,SQL_COLUMN_COUNT,NULL,sizeof(SQLINTEGER),55);
- colattr(hstmt,1,SQL_COLUMN_AUTO_INCREMENT,NULL,sizeof(SQLINTEGER),SQL_TRUE);
+ colattr(hstmt,1,SQL_COLUMN_COUNT,NULL,0,55);
+ colattr(hstmt,1,SQL_COLUMN_AUTO_INCREMENT,NULL,0,SQL_TRUE);
rc = SQLFreeStmt(hstmt,SQL_CLOSE);
mystmt(hstmt,rc);
}
void t_bigint(SQLHDBC hdbc, SQLHSTMT hstmt)
{
- SQLRETURN rc;
+ SQLRETURN rc;
SQLCHAR id[20]="999";
- SQLINTEGER nlen;
+ SQLLEN nlen;
printMessageHeader();
@@ -3152,7 +3164,7 @@
nlen = 4;
rc = SQLBindParameter(hstmt,1,SQL_PARAM_INPUT,SQL_C_LONG,
- SQL_BIGINT,20,0,&id,0,&nlen);
+ SQL_BIGINT,0,0,&id,sizeof(id),&nlen);
mystmt(hstmt,rc);
rc = SQLExecute(hstmt);
@@ -3229,7 +3241,7 @@
rc = SQLFetch(hstmt);
mystmt(hstmt,rc);
- rc = SQLGetData(hstmt,1,SQL_C_DEFAULT,&id,10,&nlen);
+ rc = SQLGetData(hstmt,1,SQL_C_DEFAULT,&id,sizeof(id),&nlen);
mystmt(hstmt,rc);
printMessage("\n id:%s,nlen:%d,%d\n",id,nlen,sizeof(SQL_BIGINT));
@@ -3243,7 +3255,8 @@
void t_setpos_upd_bug1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER id, len,id_len,f_len,l_len,ts_len;
+ long id;
+ SQLLEN len,id_len,f_len,l_len,ts_len;
SQLCHAR fname[21],lname[21],ts[17],szTable[256];
SQLUSMALLINT pccol;
@@ -3327,7 +3340,7 @@
rc = SQLExecDirect(hstmt,"DELETE FROM t_setpos_upd_bug1 WHERE fname =
'update'",SQL_NTS);
mystmt(hstmt,rc);
- rc = SQLRowCount(hstmt,(SQLINTEGER *)&len);
+ rc = SQLRowCount(hstmt,&len);
mystmt(hstmt,rc);
printMessage("\n total rows affceted:%d",len);
my_assert(len == 1);
@@ -3349,8 +3362,8 @@
void t_acc_update(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER id,id1;
- SQLINTEGER pcrow;
+ long id,id1;
+ SQLLEN pcrow;
SQLHSTMT hstmt1;
printMessageHeader();
@@ -3588,7 +3601,7 @@
SQLCHAR ColumnName[255];
SQLSMALLINT ColumnNameSize;
SQLSMALLINT ColumnSQLDataType;
- SQLUINTEGER ColumnSize;
+ SQLULEN ColumnSize;
SQLSMALLINT ColumnDecimals;
SQLSMALLINT ColumnNullable;
SQLSMALLINT index, pccol;
@@ -3597,7 +3610,7 @@
mystmt(hstmt,rc);
printMessage("total columns:%d\n",pccol);
- printMessage("\nName nlen type size decs null");
+ printMessage("Name nlen type size decs null\n");
for ( index = 1; index <= pccol; index++)
{
rc = SQLDescribeCol(hstmt, index, ColumnName,
@@ -3607,11 +3620,11 @@
&ColumnDecimals, &ColumnNullable);
mystmt(hstmt,rc);
- printMessage("\n%-6s %4d %4d %7d %4d %4d", ColumnName, ColumnNameSize,
- ColumnSQLDataType, ColumnSize, ColumnDecimals,
- ColumnNullable);
+ printMessage("%-6s %4d %4d %7ld %4d %4d\n", ColumnName,
+ ColumnNameSize, ColumnSQLDataType, ColumnSize,
+ ColumnDecimals, ColumnNullable);
}
- }
+ }
rc = SQLFreeStmt(hstmt,SQL_CLOSE);
mystmt(hstmt,rc);
@@ -3644,7 +3657,7 @@
void t_exfetch(SQLHDBC hdbc,SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER i;
+ long i;
printMessageHeader();
@@ -3766,7 +3779,8 @@
void my_setpos_upd_pk_order(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -3832,7 +3846,7 @@
rc = SQLExecDirect(hstmt,"DELETE FROM my_setpos_upd_pk_order WHERE col2 =
'updated'",SQL_NTS);
mystmt(hstmt,rc);
- rc = SQLRowCount(hstmt,(SQLINTEGER *)&nlen);
+ rc = SQLRowCount(hstmt,&nlen);
mystmt(hstmt,rc);
printMessage("\n total rows affceted:%d",nlen);
my_assert(nlen == 1);
@@ -3843,7 +3857,7 @@
void my_setpos_upd_pk_order1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500;
+ long nData= 500;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
Modified: trunk/test/test3/mytest3.c
===================================================================
--- trunk/test/test3/mytest3.c 2006-09-12 19:19:42 UTC (rev 99)
+++ trunk/test/test3/mytest3.c 2006-09-12 23:16:48 UTC (rev 100)
@@ -30,7 +30,7 @@
sprintf(query,"SELECT %s FROM %s",col,table);
fprintf(stdout,"\n %s", query);
- rc = SQLExecDirect(hstmt, (char *)query, SQL_NTS);
+ rc = SQLExecDirect(hstmt, query, SQL_NTS);
mystmt(hstmt,rc);
}
@@ -57,8 +57,8 @@
static void t_basic(SQLHDBC hdbc,SQLHSTMT hstmt)
{
SQLRETURN rc;
- int nInData = 1;
- int nOutData, nRowCount=1;
+ long nInData = 1;
+ long nOutData, nRowCount=1;
char szOutData[255];
printMessageHeader();
@@ -142,10 +142,11 @@
static void tmysql_setpos_del(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData = 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
- SQLUSMALLINT rgfRowStatus;
+ SQLSMALLINT rgfRowStatus;
printMessageHeader();
@@ -238,7 +239,8 @@
static void tmysql_setpos_del1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen, pccol;
+ long nData= 500;
+ SQLLEN nlen, pccol;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -311,7 +313,8 @@
static void t_setpos_del_all(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData[4], nlen;
+ long nData[4];
+ SQLLEN nlen;
SQLCHAR szData[4][10];
printMessageHeader();
@@ -392,7 +395,8 @@
static void tmysql_setpos_upd(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData = 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -499,7 +503,7 @@
static void t_setpos_upd_decimal(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER rec;
+ long rec;
printMessageHeader();
@@ -610,8 +614,8 @@
static void tmysql_bindcol(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- int nodata;
- long nlen, nidata = 200, length;
+ long nodata, nidata = 200;
+ SQLLEN nlen, length;
char szodata[20],szidata[20]="MySQL";
printMessageHeader();
@@ -827,7 +831,8 @@
static void tmysql_mtab_setpos_del(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -919,7 +924,8 @@
static void tmysql_setpos_pkdel(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1001,7 +1007,8 @@
static void t_alias_setpos_pkdel(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1077,7 +1084,8 @@
static void t_alias_setpos_del(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData[4], nlen;
+ long nData[4];
+ SQLLEN nlen;
SQLCHAR szData[4][10];
printMessageHeader();
@@ -1161,7 +1169,8 @@
static void tmysql_setpos_pkdel1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1237,7 +1246,8 @@
static void tmysql_setpos_pkdel2(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1365,7 +1375,8 @@
static void tmysql_setpos_pkdel3(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1435,7 +1446,8 @@
static void t_mul_pkdel(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1511,7 +1523,8 @@
static void t_mul_pkdel1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -1585,7 +1598,7 @@
{
SQLRETURN rc;
SQLCHAR szData[255];
- SQLINTEGER i;
+ long i;
printMessageHeader();
@@ -1693,7 +1706,7 @@
static void t_max_con(SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER i, max_connections, used_connections, test_connections;
+ long i, max_connections, used_connections, test_connections;
SQLHENV env;
SQLHDBC dbc[101];
@@ -2036,7 +2049,7 @@
{
SQLRETURN rc;
SQLCHAR id[20]="999";
- SQLINTEGER nlen;
+ SQLLEN nlen;
printMessageHeader();
@@ -2271,7 +2284,7 @@
SQLRETURN rc;
SQLHSTMT hstmt1,hstmt2,hstmt3;
SQLCHAR curname[50];
- SQLSMALLINT nlen;
+ SQLLEN nlen;
printMessageHeader();
@@ -2465,7 +2478,7 @@
static void t_max_rows(SQLHDBC hdbc,SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER i;
+ long i;
printMessageHeader();
@@ -2547,8 +2560,8 @@
static void t_prepare(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- int nodata;
- long nlen, nidata = 200;
+ long nidata= 200, nodata;
+ SQLLEN nlen;
char szodata[20],szidata[20]="MySQL";
short pccol;
@@ -2756,7 +2769,7 @@
static void t_scroll(SQLHDBC hdbc,SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER i;
+ long i;
printMessageHeader();
@@ -2878,7 +2891,7 @@
static void t_acc_crash(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER id;
+ long id;
SQLCHAR name[20], data[30];
SQL_TIMESTAMP_STRUCT ts;
@@ -2960,8 +2973,8 @@
static void tmysql_pcbvalue(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nodata;
- SQLINTEGER nlen, slen,tlen;
+ long nodata;
+ SQLLEN nlen, slen,tlen;
SQLCHAR szdata[20],sztdata[100];
printMessageHeader();
@@ -3052,7 +3065,8 @@
static void my_setpos_upd_pk_order(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData = 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -3134,7 +3148,7 @@
static void my_setpos_upd_pk_order1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500;
+ long nData = 500;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -3480,7 +3494,7 @@
{
SQLRETURN rc;
SQLCHAR catalog[30];
- SQLINTEGER len;
+ SQLLEN len;
printMessageHeader();
@@ -3496,7 +3510,8 @@
static void t_setpos_position(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER nData = 500, nlen;
+ long nData= 500;
+ SQLLEN nlen;
SQLCHAR szData[255]={0};
SQLUINTEGER pcrow;
@@ -3689,7 +3704,8 @@
SQLRETURN rc;
SQLHSTMT hstmt1;
SQLCHAR szData[]="updated";
- SQLINTEGER nData,pcbValue, nlen, pcrow;
+ long nData;
+ SQLLEN pcbValue, nlen, pcrow;
printMessageHeader();
@@ -4007,7 +4023,7 @@
{
SQLCHAR str[20],s_data[]="189.4567";
SQLDOUBLE d_data=189.4567;
- SQLINTEGER i_data=189, l_data=-23;
+ long i_data=189, l_data=-23;
SQLRETURN rc;
printMessageHeader();
@@ -4443,8 +4459,9 @@
static void t_pos_datetime_delete(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLHSTMT hstmt1;
- SQLINTEGER row_count, int_data, cur_type;
+ SQLHSTMT hstmt1;
+ long int_data;
+ SQLLEN row_count, cur_type;
printMessageHeader();
@@ -4567,7 +4584,8 @@
{
SQLRETURN rc;
SQLHSTMT hstmt1;
- SQLINTEGER row_count, int_data, cur_type;
+ long int_data;
+ SQLLEN row_count, cur_type;
printMessageHeader();
@@ -4693,7 +4711,8 @@
static void t_text_fetch(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER i, row_count, length;
+ long i;
+ SQLLEN row_count, length;
SQLCHAR data[TEST_ODBC_TEXT_LEN+1];
printMessageHeader();
@@ -4785,7 +4804,7 @@
SQLUINTEGER cbColumnSize, cbDecimalDigits, cbNumPrecRadix,
cbDatabaseName, cbDataType, cbNullable;
SQLRETURN rc;
- SQLUINTEGER ColumnSize, i;
+ long ColumnSize, i;
SQLUINTEGER ColumnCount= 7;
SQLUSMALLINT DecimalDigits;
SQLCHAR ColumnName[MAX_NAME_LEN], DatabaseName[MAX_NAME_LEN];
@@ -5204,7 +5223,8 @@
{
SQLRETURN rc;
SQLCHAR *data;
- SQLINTEGER length, i;
+ long i;
+ SQLLEN length;
const SQLINTEGER max_blob_size=1024*100;
printMessageHeader();
@@ -5338,7 +5358,8 @@
static void t_putdata(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER pcbLength, c1;
+ SQLLEN pcbLength;
+ long c1;
SQLCHAR data[255];
SQLPOINTER token;
@@ -5405,7 +5426,8 @@
static void t_putdata1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER pcbLength, c1;
+ SQLLEN pcbLength;
+ long c1;
SQLCHAR data[255];
SQLPOINTER token;
@@ -5474,7 +5496,8 @@
static void t_putdata2(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER pcbLength, c1;
+ SQLLEN pcbLength;
+ long c1;
SQLCHAR data[255];
SQLPOINTER token;
@@ -5560,7 +5583,7 @@
SQLRETURN rc;
SQL_TIME_STRUCT tt;
SQLCHAR data[30];
- SQLINTEGER length;
+ SQLLEN length;
printMessageHeader();
@@ -5828,7 +5851,8 @@
void t_row_array_size(SQLHDBC hdbc,SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER i,nrows,iarray[15];
+ long i, iarray[15];
+ SQLLEN nrows;
const int max_rows=9;
printMessageHeader();
@@ -5925,7 +5949,8 @@
SQLCHAR name[255];
SQLSMALLINT pccol;
SQLRETURN rc;
- SQLINTEGER rows_fetched, data[4], pcb_value[4], i;
+ SQLLEN rows_fetched, pcb_value[4];
+ long i, data[4];
SQLUSMALLINT row_status[4];
printMessageHeader();
@@ -6033,7 +6058,8 @@
static void t_empty_str_bug(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER id, name_len, desc_len;
+ long id;
+ SQLLEN name_len, desc_len;
SQLCHAR name[20], desc[20];
printMessageHeader();
@@ -6249,7 +6275,8 @@
static void t_rows_fetched_ptr1(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLUINTEGER rowsFetched, i, rowsSize;
+ SQLLEN rowsFetched, rowsSize;
+ long i;
printMessageHeader();
@@ -6499,7 +6526,7 @@
int dynData;
int commonLen= 20;
- SQLINTEGER id, id1, id2, id3, resId;
+ long id, id1, id2, id3, resId;
SQLINTEGER resUTimeSec;
SQLINTEGER resUTimeMSec;
SQLINTEGER resDataLen;
@@ -6632,7 +6659,7 @@
static void t_convert(SQLHDBC hdbc, SQLHSTMT hstmt)
{
SQLRETURN rc;
- SQLINTEGER data_len;
+ SQLLEN data_len;
SQLCHAR data[50];
printMessageHeader();
Modified: trunk/test/test32/mytest32.c
===================================================================
--- trunk/test/test32/mytest32.c 2006-09-12 19:19:42 UTC (rev 99)
+++ trunk/test/test32/mytest32.c 2006-09-12 23:16:48 UTC (rev 100)
@@ -34,8 +34,9 @@
void t_prep_basic()
{
- SQLINTEGER pcrow, id, length1, length2;
- SQLCHAR name[20];
+ SQLLEN pcrow, length1, length2;
+ long id;
+ char name[20];
SQLExecDirect(hstmt,"drop table t_prep_basic",SQL_NTS);
@@ -75,7 +76,7 @@
mystmt(hstmt,rc);
printMessage( "\n outdata: %d(%d), %s(%d)",id,length1,name,length2);
- myassert(id == 100 && length1 == sizeof(SQLINTEGER));
+ myassert(id == 100 && length1 == sizeof(long));
myassert(strcmp(name,"venu")==0 && length2 == 4);
rc = SQLFetch(hstmt);
@@ -94,8 +95,8 @@
void t_prep_buffer_length()
{
- SQLINTEGER length;
- SQLCHAR buffer[20];
+ SQLLEN length;
+ char buffer[20];
SQLExecDirect(hstmt,"drop table t_prep_buffer_length",SQL_NTS);
@@ -189,7 +190,7 @@
void t_prep_truncate()
{
- SQLINTEGER pcrow, length, length1;
+ SQLLEN pcrow, length, length1;
SQLCHAR name[20], bin[10];
@@ -257,7 +258,7 @@
void t_prep_scroll()
{
- SQLINTEGER i, data, max_rows= 5;
+ long i, data, max_rows= 5;
SQLExecDirect(hstmt,"drop table t_prep_scroll",SQL_NTS);
@@ -373,7 +374,7 @@
void t_prep_getdata()
{
SQLCHAR name[10];
- SQLINTEGER data, length;
+ long data, length;
SQLCHAR tiny;
SQLExecDirect(hstmt,"drop table t_prep_getdata",SQL_NTS);
@@ -456,7 +457,7 @@
void t_prep_getdata1()
{
SQLCHAR data[11];
- SQLUINTEGER length;
+ SQLLEN length;
SQLExecDirect(hstmt,"drop table t_prep_getdata",SQL_NTS);
@@ -578,7 +579,7 @@
void t_prep_catalog()
{
SQLCHAR table[20];
- SQLUINTEGER length;
+ SQLLEN length;
SQLExecDirect(hstmt,"drop table t_prep_catalog",SQL_NTS);
@@ -741,7 +742,8 @@
void t_rows_fetched_ptr()
{
- SQLUINTEGER rowsFetched, i, rowsSize;
+ SQLLEN rowsFetched, rowsSize;
+ long i;
SQLExecDirect(hstmt,"drop table t_rows_fetched_ptr",SQL_NTS);
@@ -867,9 +869,10 @@
}
void t_sps()
-{
- SQLINTEGER a, a1, length, length1;
- SQLCHAR b[]= "abcdefghij", b1[10];
+{
+ SQLLEN length, length1;
+ long a, a1;
+ char b[]= "abcdefghij", b1[10];
/*
if (!mysql_min_version(hdbc, "5.0",3))
| Thread |
|---|
| • Connector/ODBC 3.51 commit: r100 - in trunk/test: include test test3 test32 | jwinstead | 13 Sep |