~ubuntu-branches/debian/sid/unixodbc/sid

« back to all changes in this revision

Viewing changes to DriverManager/SQLExecDirect.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2004-10-15 03:07:52 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041015030752-dzw4vhxlgycz3woj
Tags: 2.2.4-11
Brown paper bag me: conflicts do not write themselves just because
you add a line to the changelog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 *
27
27
 **********************************************************************
28
28
 *
29
 
 * $Id: SQLExecDirect.c,v 1.2 2001/12/13 13:00:32 lurcher Exp $
 
29
 * $Id: SQLExecDirect.c,v 1.7 2002/12/05 17:44:30 lurcher Exp $
30
30
 *
31
31
 * $Log: SQLExecDirect.c,v $
 
32
 * Revision 1.7  2002/12/05 17:44:30  lurcher
 
33
 *
 
34
 * Display unknown return values in return logging
 
35
 *
 
36
 * Revision 1.6  2002/07/24 08:49:52  lurcher
 
37
 *
 
38
 * Alter UNICODE support to use iconv for UNICODE-ANSI conversion
 
39
 *
 
40
 * Revision 1.5  2002/07/18 15:21:56  lurcher
 
41
 *
 
42
 * Fix problem with SQLExecute/SQLExecDirect returning SQL_NO_DATA
 
43
 *
 
44
 * Revision 1.4  2002/01/21 18:00:51  lurcher
 
45
 *
 
46
 * Assorted fixed and changes, mainly UNICODE/bug fixes
 
47
 *
 
48
 * Revision 1.3  2002/01/15 14:47:44  lurcher
 
49
 *
 
50
 * Reset stmt->prepared flag after entering a SQLParamData state from
 
51
 * SQLExecDirect
 
52
 *
32
53
 * Revision 1.2  2001/12/13 13:00:32  lurcher
33
54
 *
34
55
 * Remove most if not all warnings on 64 bit platforms
133
154
 
134
155
#include "drivermanager.h"
135
156
 
136
 
static char const rcsid[]= "$RCSfile: SQLExecDirect.c,v $ $Revision: 1.2 $";
 
157
static char const rcsid[]= "$RCSfile: SQLExecDirect.c,v $ $Revision: 1.7 $";
137
158
 
138
159
SQLRETURN SQLExecDirect( SQLHSTMT statement_handle,
139
160
           SQLCHAR *statement_text,
142
163
    DMHSTMT statement = (DMHSTMT) statement_handle;
143
164
    SQLRETURN ret;
144
165
    SQLCHAR *s1;
 
166
    SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ];
145
167
 
146
168
    /*
147
169
     * check statement
314
336
            return function_return( statement, SQL_ERROR );
315
337
        }
316
338
 
317
 
        s1 = ansi_to_unicode( statement_text, text_length );
 
339
        s1 = ansi_to_unicode_alloc( statement_text, text_length, statement -> connection );
318
340
 
319
341
        ret = SQLEXECDIRECTW( statement -> connection,
320
342
                statement -> driver_stmt,
384
406
        statement -> connection -> state = STATE_C6;
385
407
         */
386
408
    }
 
409
    else if ( ret == SQL_NO_DATA )
 
410
    {
 
411
        statement -> state = STATE_S4;
 
412
        statement -> prepared = 0;
 
413
    }
387
414
    else if ( ret == SQL_NEED_DATA )
388
415
    {
389
416
        statement -> interupted_func = SQL_API_SQLEXECDIRECT;
390
417
        statement -> interupted_state = statement -> state;
391
418
        statement -> state = STATE_S8;
 
419
 
 
420
        statement -> prepared = 0;
392
421
    }
393
422
    else if ( ret == SQL_STILL_EXECUTING )
394
423
    {
396
425
        if ( statement -> state != STATE_S11 &&
397
426
                statement -> state != STATE_S12 )
398
427
            statement -> state = STATE_S11;
 
428
 
 
429
        statement -> prepared = 0;
399
430
    }
400
431
    else
401
432
    {
402
 
        statement -> state = STATE_S2;
 
433
        statement -> state = STATE_S1;
403
434
    }
404
435
 
405
436
    if ( log_info.log_flag )
406
437
    {
407
438
        sprintf( statement -> msg, 
408
439
                "\n\t\tExit:[%s]",
409
 
                    __get_return_status( ret ));
 
440
                    __get_return_status( ret, s2 ));
410
441
 
411
442
        dm_log_write( __FILE__, 
412
443
                __LINE__,