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

« back to all changes in this revision

Viewing changes to DriverManager/SQLNativeSqlW.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:
27
27
 *
28
28
 **********************************************************************
29
29
 *
30
 
 * $Id: SQLNativeSqlW.c,v 1.2 2001/12/13 13:00:32 lurcher Exp $
 
30
 * $Id: SQLNativeSqlW.c,v 1.5 2002/12/05 17:44:31 lurcher Exp $
31
31
 *
32
32
 * $Log: SQLNativeSqlW.c,v $
 
33
 * Revision 1.5  2002/12/05 17:44:31  lurcher
 
34
 *
 
35
 * Display unknown return values in return logging
 
36
 *
 
37
 * Revision 1.4  2002/08/23 09:42:37  lurcher
 
38
 *
 
39
 * Fix some build warnings with casts, and a AIX linker mod, to include
 
40
 * deplib's on the link line, but not the libtool generated ones
 
41
 *
 
42
 * Revision 1.3  2002/07/24 08:49:52  lurcher
 
43
 *
 
44
 * Alter UNICODE support to use iconv for UNICODE-ANSI conversion
 
45
 *
33
46
 * Revision 1.2  2001/12/13 13:00:32  lurcher
34
47
 *
35
48
 * Remove most if not all warnings on 64 bit platforms
71
84
    DMHDBC connection = (DMHDBC)hdbc;
72
85
    SQLRETURN ret;
73
86
    SQLCHAR *s1;
 
87
    SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ];
74
88
 
75
89
    /*
76
90
     * check connection
225
239
    }
226
240
    else
227
241
    {
 
242
        SQLCHAR *as1 = NULL, *as2 = NULL;
 
243
 
228
244
        if ( !CHECK_SQLNATIVESQL( connection ))
229
245
        {
230
246
            dm_log_write( __FILE__, 
242
258
            return function_return( connection, SQL_ERROR );
243
259
        }
244
260
 
245
 
        unicode_to_ansi( sz_sql_str_in, cb_sql_str_in );
 
261
        as1 = (SQLCHAR*) unicode_to_ansi_alloc( sz_sql_str_in, cb_sql_str_in, connection );
 
262
 
 
263
        if ( cb_sql_str_max > 0 && sz_sql_str )
 
264
        {
 
265
            as2 = malloc( cb_sql_str_max + 1 );
 
266
        }
246
267
 
247
268
        ret = SQLNATIVESQL( connection,
248
269
                connection -> driver_dbc,
249
 
                sz_sql_str_in,
 
270
                as1 ? as1 : (SQLCHAR*) sz_sql_str_in,
250
271
                cb_sql_str_in,
251
 
                sz_sql_str,
 
272
                as2 ? as2 : (SQLCHAR*) sz_sql_str,
252
273
                cb_sql_str_max,
253
274
                pcb_sql_str );
254
275
 
255
 
        ansi_back_to_unicode((char*) sz_sql_str_in, cb_sql_str_in );
256
 
        ansi_to_unicode_in_place((SQLCHAR*) sz_sql_str, SQL_NTS );
 
276
        if ( SQL_SUCCEEDED( ret ) && as2 && sz_sql_str )
 
277
        {
 
278
            ansi_to_unicode_copy( sz_sql_str, (char*) as2, SQL_NTS, connection );
 
279
        }
 
280
 
 
281
        if ( as1 ) free( as1 );
 
282
        if ( as2 ) free( as2 );
257
283
    }
258
284
 
259
285
    if ( log_info.log_flag )
282
308
        sprintf( connection -> msg, 
283
309
                "\n\t\tExit:[%s]\
284
310
                \n\t\t\tSQL Out = %s",
285
 
                    __get_return_status( ret ),
 
311
                    __get_return_status( ret, s2 ),
286
312
                    __data_as_string( s1, SQL_CHAR, 
287
313
                        (SQLLEN*)pcb_sql_str, sz_sql_str ));
288
314