pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
 [ psqlodbc-Bugs-1000477 ] Long parameters are not parsed from initialization string and unitialized options
3+ messages / 1 participants
[nested] [flat]

*  [ psqlodbc-Bugs-1000477 ] Long parameters are not parsed from initialization string and unitialized options
@ 2005-12-09 14:39  noreply@pgfoundry.org
  0 siblings, 0 replies; 3+ messages in thread

From: noreply@pgfoundry.org @ 2005-12-09 14:39 UTC (permalink / raw)
  To: noreply@pgfoundry.org

Bugs item #1000477, was opened at 2005-12-09 14:39
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000477&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: Long parameters are not parsed from initialization string and unitialized options

Initial Comment:

SQLConfigDataSource( NULL,ODBC_CONFIG_DSN,
 "PostgreSQL Unicode",
 "DSN=Example\0SERVER=localhost\0DATABASE=template1\0Username=postgres\0UseServerSidePrepare=1\0TextAsLongVarchar=1\0ByteaAsLongVarBinary=1\0\0")

This creates new DSN but options such as ByteaAsLongVarBinary and TextAsLongVarchar  are set to -1 instead of 1. Thats because ParseAttributes function in SETUP.C file accepts only keys smaller then 15 characters:

#define MAXKEYLEN		(15+1)	/* Max keyword length */ 
char aszKey[MAXKEYLEN];

There are some options much longer than 15 chars an they are not parsed.

In general uninitialized options shouldn't be saved in registry (ODBC.INI) but CC_conninfo_init initializes some options to -1 and they are never updated to proper default values:

// connection.c
CC_conninfo_init(ConnInfo *conninfo)
{
		memset(conninfo, 0, sizeof(ConnInfo));
		conninfo->disallow_premature = -1; //!!
		conninfo->allow_keyset = -1; // !!
		conninfo->lf_conversion = -1; // !!
		conninfo->true_is_minus1 = -1; // !!
		conninfo->int8_as = -101;
		conninfo->bytea_as_longvarbinary = -1; //!!
		conninfo->use_server_side_prepare = -1; //!!
		memcpy(&(conninfo->drivers), &globals, sizeof(globals));
}


----------------------------------------------------------------------

You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000477&group_id=1000125



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

*  [ psqlodbc-Bugs-1000477 ] Long parameters are not parsed from initialization string and unitialized options
@ 2005-12-09 22:19  noreply@pgfoundry.org
  0 siblings, 0 replies; 3+ messages in thread

From: noreply@pgfoundry.org @ 2005-12-09 22:19 UTC (permalink / raw)
  To: noreply@pgfoundry.org

Bugs item #1000477, was opened at 2005-12-09 15:39
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000477&group_id=1000125

Category: None
Group: None
Status: Open
>Resolution: Accepted
Priority: 3
Submitted By: Nobody (None)
>Assigned to: Ludek Finstrle (luf)
Summary: Long parameters are not parsed from initialization string and unitialized options

Initial Comment:

SQLConfigDataSource( NULL,ODBC_CONFIG_DSN,
 "PostgreSQL Unicode",
 "DSN=Example\0SERVER=localhost\0DATABASE=template1\0Username=postgres\0UseServerSidePrepare=1\0TextAsLongVarchar=1\0ByteaAsLongVarBinary=1\0\0")

This creates new DSN but options such as ByteaAsLongVarBinary and TextAsLongVarchar  are set to -1 instead of 1. Thats because ParseAttributes function in SETUP.C file accepts only keys smaller then 15 characters:

#define MAXKEYLEN		(15+1)	/* Max keyword length */ 
char aszKey[MAXKEYLEN];

There are some options much longer than 15 chars an they are not parsed.

In general uninitialized options shouldn't be saved in registry (ODBC.INI) but CC_conninfo_init initializes some options to -1 and they are never updated to proper default values:

// connection.c
CC_conninfo_init(ConnInfo *conninfo)
{
		memset(conninfo, 0, sizeof(ConnInfo));
		conninfo->disallow_premature = -1; //!!
		conninfo->allow_keyset = -1; // !!
		conninfo->lf_conversion = -1; // !!
		conninfo->true_is_minus1 = -1; // !!
		conninfo->int8_as = -101;
		conninfo->bytea_as_longvarbinary = -1; //!!
		conninfo->use_server_side_prepare = -1; //!!
		memcpy(&(conninfo->drivers), &globals, sizeof(globals));
}


----------------------------------------------------------------------

>Comment By: Ludek Finstrle (luf)
Date: 2005-12-09 23:19

Message:
Please try new development snapshot. Problems may disappear with 8.01.0104.
If you are using ODBC on linux try attached patch.

----------------------------------------------------------------------

You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000477&group_id=1000125



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

*  [ psqlodbc-Bugs-1000477 ] Long parameters are not parsed from initialization string and unitialized options
@ 2005-12-09 22:51  noreply@pgfoundry.org
  0 siblings, 0 replies; 3+ messages in thread

From: noreply@pgfoundry.org @ 2005-12-09 22:51 UTC (permalink / raw)
  To: noreply@pgfoundry.org

Bugs item #1000477, was opened at 2005-12-09 14:39
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000477&group_id=1000125

Category: None
Group: None
>Status: Closed
Resolution: Accepted
Priority: 3
Submitted By: Nobody (None)
Assigned to: Ludek Finstrle (luf)
Summary: Long parameters are not parsed from initialization string and unitialized options

Initial Comment:

SQLConfigDataSource( NULL,ODBC_CONFIG_DSN,
 "PostgreSQL Unicode",
 "DSN=Example\0SERVER=localhost\0DATABASE=template1\0Username=postgres\0UseServerSidePrepare=1\0TextAsLongVarchar=1\0ByteaAsLongVarBinary=1\0\0")

This creates new DSN but options such as ByteaAsLongVarBinary and TextAsLongVarchar  are set to -1 instead of 1. Thats because ParseAttributes function in SETUP.C file accepts only keys smaller then 15 characters:

#define MAXKEYLEN		(15+1)	/* Max keyword length */ 
char aszKey[MAXKEYLEN];

There are some options much longer than 15 chars an they are not parsed.

In general uninitialized options shouldn't be saved in registry (ODBC.INI) but CC_conninfo_init initializes some options to -1 and they are never updated to proper default values:

// connection.c
CC_conninfo_init(ConnInfo *conninfo)
{
		memset(conninfo, 0, sizeof(ConnInfo));
		conninfo->disallow_premature = -1; //!!
		conninfo->allow_keyset = -1; // !!
		conninfo->lf_conversion = -1; // !!
		conninfo->true_is_minus1 = -1; // !!
		conninfo->int8_as = -101;
		conninfo->bytea_as_longvarbinary = -1; //!!
		conninfo->use_server_side_prepare = -1; //!!
		memcpy(&(conninfo->drivers), &globals, sizeof(globals));
}


----------------------------------------------------------------------

>Comment By: Dave Page  (dpage)
Date: 2005-12-09 22:51

Message:
Thanks, patch applied.

----------------------------------------------------------------------

Comment By: Ludek Finstrle (luf)
Date: 2005-12-09 22:19

Message:
Please try new development snapshot. Problems may disappear with 8.01.0104.
If you are using ODBC on linux try attached patch.

----------------------------------------------------------------------

You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000477&group_id=1000125



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-12-09 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-09 14:39  [ psqlodbc-Bugs-1000477 ] Long parameters are not parsed from initialization string and unitialized options noreply@pgfoundry.org
2005-12-09 22:19  [ psqlodbc-Bugs-1000477 ] Long parameters are not parsed from initialization string and unitialized options noreply@pgfoundry.org
2005-12-09 22:51  [ psqlodbc-Bugs-1000477 ] Long parameters are not parsed from initialization string and unitialized options noreply@pgfoundry.org

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox