[Asterisk-code-review] res_odbc.h: Added StrLen_or_IndPtr for use in SQLBindParameter (asterisk[16])

Abhay Gupta asteriskteam at digium.com
Mon Mar 2 10:44:32 CST 2020


Abhay Gupta has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/13851 )

Change subject: res_odbc.h: Added StrLen_or_IndPtr for use in SQLBindParameter
......................................................................


Patch Set 1:

> Patch Set 1:
> 
> Whats version of Ignite is affected?
> 
> According to ODBC specification
> 
> https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlbindparameter-function?view=sql-server-ver15#strlen_or_indptr-argument
> "If StrLen_or_IndPtr is a null pointer, the driver assumes that all input parameter values are non-NULL and that character and binary data is null-terminated."
> 
> https://www.ibm.com/support/knowledgecenter/en/SSEPEK_11.0.0/odbc/src/tpc/db2z_fnbindparameter.html
> "If the fCType argument indicates character data (explicitly, or implicitly with SQL_C_DEFAULT), and the pcbValue argument is set to NULL, it is assumed that the application always provides a nul-terminated string in the buffer to which the rgbValue argument points. This null setting also implies that the parameter marker never uses null values."
> 
> I think it was fixed in Ignite v2.3
> https://issues.apache.org/jira/browse/IGNITE-6211
> "ODBC: SQLBindParameter should not unbind parameter if the ParameterValuePtr is NULL"

We are using Ignite V2.7 . In the above doc from Microsoft "SQL_NTS. The parameter value is a null-terminated string." In the patch i am passing the reference to StrLen_or_IndPtr whose value is SQL_NTS and that is as per the said document . Without which ( i.e with passing NULL ) even the query for pjsip show endpoints which fires "select * from ps_endpoints where id like ?' parameter '%' would not return any value from the table .


-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13851
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ia8c3fda14b9008e22fb4893204911259f600b32e
Gerrit-Change-Number: 13851
Gerrit-PatchSet: 1
Gerrit-Owner: Abhay Gupta <abhay at avissol.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-CC: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Comment-Date: Mon, 02 Mar 2020 16:44:32 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200302/8fe16c40/attachment.html>


More information about the asterisk-code-review mailing list