32 fprintf(stderr,
"%s\n", msg);
42 char *all_res =
strdup(possible_results);
62 for (res = strtok(all_res,
"-"); res; res = strtok(
NULL,
"-"))
67 sprintf(msg,
"flags:%s\nexpected: %s\nwrong column %d flags",
flags, possible_results,
n + 1);
77 fprintf(stdout,
"%s: Testing query\n",
cmd);
117 fprintf(stdout,
"%s: Testing flags from server\n", __FILE__);
119 fprintf(stderr,
"try_tds_login() failed\n");
123 if (
run_query(
tds,
"create table #tmp1 (i numeric(10,0) identity primary key, b varchar(20) null, c int not null)") !=
133 if (
info->num_cols != 3) {
134 sprintf(mymsg,
"wrong number of columns returned expected 3 got %d",
info->num_cols);
147 test_begin(
"select c, b from #tmp1 for browse");
150 if (
info->num_cols != 3)
161 check_flags(
info->columns[2], 2,
"writable identity key hidden-writable key hidden");
static void check_flags(TDSCOLUMN *curcol, int n, const char *possible_results)
int main(int argc, char **argv)
static void fatal_error(const char *msg)
static void test_end(void)
static void test_begin(const char *cmd)
int strcmp(const char *str1, const char *str2)
#define tds_process_tokens
Metadata about columns in regular and compute rows.
unsigned int column_writeable
unsigned int column_identity
unsigned int column_nullable
unsigned int column_hidden
Hold information for any results.
Information for a server connection.
TDSRESULTINFO * current_results
Current query information.
int run_query(TDSSOCKET *tds, const char *query)
int try_tds_logout(TDSLOGIN *login, TDSSOCKET *tds, int verbose)
int try_tds_login(TDSLOGIN **login, TDSSOCKET **tds, const char *appname, int verbose)
#define TDS_ROWFMT_RESULT
tds_sysdep_int32_type TDS_INT
#define TDS_NO_MORE_RESULTS
@ TDS_DONE_ERROR
error occurred