Revision: 179
http://informixdb.svn.sourceforge.net/informixdb/?rev=179&view=rev
Author: chaese
Date: 2008-02-09 10:29:41 -0800 (Sat, 09 Feb 2008)
Log Message:
-----------
Preserve trailing spaces when writing/reading to/from varchar columns.
There might not be an actual use case for this behavior, but strictly
speaking it is the correct behavior.
Modified Paths:
--------------
trunk/informixdb/ext/_informixdb.ec
Modified: trunk/informixdb/ext/_informixdb.ec
===================================================================
--- trunk/informixdb/ext/_informixdb.ec 2007-12-21 16:22:29 UTC (rev 178)
+++ trunk/informixdb/ext/_informixdb.ec 2008-02-09 18:29:41 UTC (rev 179)
@@ -1451,7 +1451,7 @@
else
$endif;
{
- var->sqltype = CSTRINGTYPE;
+ var->sqltype = CVCHARTYPE;
var->sqldata = malloc(n+1);
var->sqllen = n+1;
*var->sqlind = 0;
@@ -1798,6 +1798,10 @@
case SQLINTERVAL:
var->sqltype = CINVTYPE;
break;
+ case SQLVCHAR:
+ case SQLNVCHAR:
+ var->sqltype = CVCHARTYPE;
+ break;
default: {
int known_type = 0;
$ifdef HAVE_ESQL9;
@@ -2391,16 +2395,17 @@
}
}
case SQLCHAR:
+ case SQLNCHAR:
+ {
+ _clip_char((char*)data);
+ return Py_BuildValue("s", (char*)data);
+ }
case SQLVCHAR:
- case SQLNCHAR:
case SQLNVCHAR:
$ifdef HAVE_ESQL9;
case SQLLVARCHAR:
$endif;
- {
- _clip_char((char*)data);
return Py_BuildValue("s", (char*)data);
- }
case SQLFLOAT:
return PyFloat_FromDouble(*(double*)data);
case SQLSMFLOAT:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|