Issue 58318

Summary: SQL being incorrectly processed for ODBC.
Product: Base Reporter: johngrubb <jgrubb>
Component: codeAssignee: dbaneedsconfirm <needsconfirm>
Status: CLOSED NOT_AN_OOO_ISSUE QA Contact: issues@dba <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 2.0Keywords: needmoreinfo
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Zip of the trace none

Description johngrubb 2005-11-22 17:22:59 UTC
This is Definitely related to 50442, which was incorrectly resolved as invalid.

The case for Progress 9 target DB,  but will be affecting any DB which does not
have an identifier quoting character.  The Progress SQL89/4GL implementation
does not have a quoting character.  The SQL92 does,  but SQL89 is extremely common.

If a table has a "-" (or other special character) in the name of a field,  the
SQL will be parsed with the hyphen interpreted as minus sign.  Field definition,
 as per SQLColumns api call from odbctest:

<Null>, "pro1", "Customer", "Cust-Num", 4, "integer", 5, 4, 0, 10, 1, "", "0",
4, 0, <Null>, 10, "YES", ">>>>9"

The field name is Cust-Num.  Progress does not have a quoting charater,  so the
name must be reproduced as that string.  In accessing the table in the Base
front,  the table generates an error,  "Unknown field or variable name Cust".
The ODBC Trace reveals this is the guilty call.

New Database3   15ac-1140	ENTER SQLPrepare 
		HSTMT               06501CB8
		UCHAR *             0x068C3140 [      66] "SELECT * FROM SPORTS.Customer WHERE
SPORTS.Customer.Cust - Num = ?"
		SDWORD                    66

New Database3   15ac-1140	EXIT  SQLPrepare  with return code -1 (SQL_ERROR)
		HSTMT               06501CB8
		UCHAR *             0x068C3140 [      66] "SELECT * FROM SPORTS.Customer WHERE
SPORTS.Customer.Cust - Num = ?"
		SDWORD                    66

		DIAG [HY000] [OpenLink][ODBC][Progress Server]** Unknown Field or Variable
name - Cust. (201) (201) 


Note the SQL "SELECT * FROM SPORTS.Customer WHERE SPORTS.Customer.Cust - Num =
?".  I am unsure why a parameter is being defined here,  but it may be due to a
different bug in the parser.  The User operation is supposed to retrieve the
data.  There is no limits or the query for other tables.  If there is no quoting
character (SQLGetInfo for SQL_IDENTIFIER_QUOTE_CHAR),  the sql statement must
not have the added spaces.   I will be posting the full trace.
Comment 1 johngrubb 2005-11-22 17:24:42 UTC
Created attachment 31716 [details]
Zip of the trace
Comment 2 christoph.lukasiak 2006-04-24 16:02:32 UTC
does it still occure in current version?
Comment 3 christoph.lukasiak 2006-06-12 15:23:23 UTC
no respond -> seems to be fixed in between
Comment 4 christoph.lukasiak 2006-06-12 15:24:27 UTC
=> close

do not hestitate to reopen this issue if bug is still reproducable in current
version

thx