~ubuntu-branches/ubuntu/trusty/psqlodbc/trusty-proposed

« back to all changes in this revision

Viewing changes to odbcapi30w.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2011-04-05 14:48:23 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20110405144823-n77supsa1hjj0ik6
Tags: 1:09.00.0200-1
* New upstream release.
* Fix installing {A,W}/usr/lib/odbc.  Closes: #618210.
* Convert to 3.0 (quilt).
* Remove psqlodbc-580878.diff: implemented upstream.
* Remove psqlodbc-585476.diff: was caused by #519006 which is now closed.
* Update description, suggested by Martin Eberhard Schauer.
  Closes: #565611.
* New maintainer.  Closes: #472818.

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
                        utf8_to_ucs2(qstr, strlen(qstr), szSqlState, 6);
235
235
                if (mtxt && tlen <= cbErrorMsgMax)
236
236
                {
237
 
                        tlen = (SQLSMALLINT) utf8_to_ucs2(mtxt, tlen, szErrorMsg, cbErrorMsgMax);
 
237
                        SQLULEN ulen = utf8_to_ucs2_lf1(mtxt, tlen, FALSE, szErrorMsg, cbErrorMsgMax);
 
238
                        if (ulen == (SQLULEN) -1)
 
239
                        {
 
240
                                tlen = (SQLSMALLINT) msgtowstr(NULL, mtxt,
 
241
                                        (int) tlen, (LPWSTR) szErrorMsg, (int) cbErrorMsgMax);
 
242
                        }
 
243
                        else
 
244
                                tlen = (SQLSMALLINT) ulen;
238
245
                        if (tlen >= cbErrorMsgMax)
239
246
                                ret = SQL_SUCCESS_WITH_INFO;
240
247
                }
255
262
        SQLPOINTER      pCharAttr,
256
263
        SQLSMALLINT     cbCharAttrMax,  
257
264
        SQLSMALLINT     *pcbCharAttr,
258
 
#if defined(WITH_UNIXODBC) || (defined(WIN32) && ! defined(_WIN64))
 
265
#if defined(_WIN64) || defined(SQLCOLATTRIBUTE_SQLLEN)
 
266
        SQLLEN          *pNumAttr
 
267
#else
259
268
        SQLPOINTER      pNumAttr
260
 
#else
261
 
        SQLLEN          *pNumAttr
262
269
#endif
263
270
        )
264
271
{
362
369
                        }
363
370
                        if (SQL_SUCCEEDED(ret))
364
371
                        {
365
 
                                blen = (SQLSMALLINT) utf8_to_ucs2(rgbD, blen, (SQLWCHAR *) rgbDiagInfo, cbDiagInfoMax / WCLEN);
 
372
                                SQLULEN ulen = (SQLSMALLINT) utf8_to_ucs2_lf1(rgbD, blen, FALSE, (SQLWCHAR *) rgbDiagInfo, cbDiagInfoMax / WCLEN);
 
373
                                if (ulen == (SQLULEN) -1)
 
374
                                {
 
375
                                        blen = (SQLSMALLINT) msgtowstr(NULL, rgbD,
 
376
                                                (int) blen, (LPWSTR) rgbDiagInfo, (int) cbDiagInfoMax / WCLEN);
 
377
                                }
 
378
                                else
 
379
                                        blen = (SQLSMALLINT) ulen;
366
380
                                if (SQL_SUCCESS == ret && blen * WCLEN >= cbDiagInfoMax)
367
381
                                        ret = SQL_SUCCESS_WITH_INFO;
368
382
                                if (pcbDiagInfo)