~ubuntu-branches/debian/lenny/freetds/lenny

« back to all changes in this revision

Viewing changes to src/dblib/unittests/t0003.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2008-08-02 11:49:53 UTC
  • mfrom: (2.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080802114953-0qdeowgl63k42n2c
Tags: 0.82-4
* Fix a typo in the freetds-common description, ugh
* Versioned replaces of libct4 by freetds-common, since the current one
  obviously doesn't have overlapping files.
* tdsodbc: check for /var/lib/odbc existence before removing it in the
  postinst, since there are cases where it won't exist on upgrade (i.e.,
  if the driver was never enabled in the first place).  Closes: #493303.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#if HAVE_CONFIG_H
2
 
#include <config.h>
3
 
#endif /* HAVE_CONFIG_H */
4
 
 
5
 
#include <stdio.h>
6
 
 
7
 
#if HAVE_STDLIB_H
8
 
#include <stdlib.h>
9
 
#endif /* HAVE_STDLIB_H */
10
 
 
11
 
#if HAVE_STRING_H
12
 
#include <string.h>
13
 
#endif /* HAVE_STRING_H */
14
 
 
15
 
#include <sqlfront.h>
16
 
#include <sqldb.h>
 
1
/* 
 
2
 * Purpose: Test buffering
 
3
 * Functions: dbclrbuf dbgetrow dbsetopt 
 
4
 */
17
5
 
18
6
#include "common.h"
19
7
 
20
 
 
21
 
 
22
 
static char software_version[] = "$Id: t0003.c,v 1.9 2004/09/09 08:54:49 freddy77 Exp $";
 
8
static char software_version[] = "$Id: t0003.c,v 1.13 2007/12/04 02:06:38 jklowden Exp $";
23
9
static void *no_unused_var_warn[] = { software_version, no_unused_var_warn };
24
10
 
25
11
 
71
57
        dbloginfree(login);
72
58
        add_bread_crumb();
73
59
 
 
60
#ifdef MICROSOFT_DBLIB
 
61
        dbsetopt(dbproc, DBBUFFER, "100");
 
62
#else
74
63
        dbsetopt(dbproc, DBBUFFER, "100", 0);
75
 
        add_bread_crumb();
76
 
 
77
 
        fprintf(stdout, "Dropping table\n");
78
 
        add_bread_crumb();
79
 
        dbcmd(dbproc, "drop table #dblib0003");
80
 
        add_bread_crumb();
81
 
        dbsqlexec(dbproc);
82
 
        add_bread_crumb();
83
 
        while (dbresults(dbproc) != NO_MORE_RESULTS) {
84
 
                /* nop */
85
 
        }
 
64
#endif
86
65
        add_bread_crumb();
87
66
 
88
67
        fprintf(stdout, "creating table\n");
125
104
        }
126
105
 
127
106
        add_bread_crumb();
128
 
        dbbind(dbproc, 1, INTBIND, -1, (BYTE *) & testint);
 
107
        dbbind(dbproc, 1, INTBIND, 0, (BYTE *) & testint);
129
108
        add_bread_crumb();
130
 
        dbbind(dbproc, 2, STRINGBIND, -1, (BYTE *) teststr);
 
109
        dbbind(dbproc, 2, STRINGBIND, 0, (BYTE *) teststr);
131
110
        add_bread_crumb();
132
111
 
133
112
        add_bread_crumb();