Go to the documentation of this file.Go to the SVN repository for this file.
13 const unsigned int buf_size = 128;
14 char *
buf = (
char *) malloc(buf_size);
16 sprintf(
sql,
"SELECT '%s'", data);
23 fprintf(stderr,
"Unexpected sql state returned\n");
34 mycmp(
const char *s1,
const char *s2)
49 return memcmp(s1,
buf, l *
lc +
lc);
55 #define CheckLen(x) do { \
57 fprintf(stderr, "Wrong len %ld at line %d expected %d\n", (long int) len, __LINE__, (x)); \
67 sprintf(
sql,
"SELECT CONVERT(%sTEXT,'Prova' + REPLICATE('x',500))", n_flag);
85 printf(
"Wrong data result 1\n");
93 if (
mycmp(
buf,
"ovaxxxxxxxxxxxx") != 0) {
94 printf(
"Wrong data result 2 res = '%s'\n",
buf);
109 sprintf(
sql,
"SELECT CONVERT(%sVARCHAR(100), 'Other test')", n_flag);
117 printf(
"Wrong data result 1\n");
124 printf(
"Wrong data result 2 res = '%s'\n",
buf);
165 int_buf = 0xdeadbeef;
167 if (int_buf != 12345) {
168 printf(
"Wrong data result\n");
173 if (int_buf != 12345) {
174 printf(
"Wrong data result 2 res = %d\n", (
int) int_buf);
181 odbc_command(
"SELECT CONVERT(NUMERIC(18,5), 1850000000000)");
185 memset(
buf,
'x',
sizeof(
buf));
189 printf(
"Wrong data result: %s\n",
buf);
197 printf(
"Wrong data result 3 res = %s\n",
buf);
209 memset(
buf,
'x',
sizeof(
buf));
211 #ifdef ENABLE_DEVELOPING
214 fprintf(stderr,
"Wrong buffer result buf = %s\n",
buf);
220 fprintf(stderr,
"Unexpected sql state %s returned\n",
odbc_sqlstate);
228 rc =
odbc_command2(
"SELECT CONVERT(UNIQUEIDENTIFIER, 'AA7DF450-F119-11CD-8465-00AA00425D90')",
"SENo");
236 fprintf(stderr,
"Unexpected sql state %s returned\n",
odbc_sqlstate);
278 fprintf(stderr,
"Wrong len returned, returned %ld\n", (
long)
len);
296 fprintf(stderr,
"Wrong len returned, returned %ld\n", (
long)
len);
318 fprintf(stderr,
"Wrong len returned, returned %ld\n", (
long)
len);
#define odbc_reset_statement()
#define CHKGetData(a, b, c, d, e, res)
#define odbc_command(cmd)
#define odbc_command2(cmd, res)
int main(int argc, char *argv[])
static void test_err(const char *data, int c_type, const char *state)
static int mycmp(const char *s1, const char *s2)
static void test_split(const char *n_flag)
int strcmp(const char *str1, const char *str2)
unsigned int odbc_db_version_int(void)
int odbc_disconnect(void)
int odbc_db_is_microsoft(void)
void odbc_read_error(void)
static SQLRETURN odbc_connect(TDS_DBC *dbc, TDSLOGIN *login)
SQLRETURN SQLFetch(SQLHSTMT StatementHandle)