Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-standard constant SQL_NVARCHAR #210

Merged
merged 1 commit into from Mar 6, 2019

Conversation

2 participants
@mloskot
Copy link
Member

mloskot commented Feb 27, 2019

What does this PR do?

Clear use of the non-standard type constant:

It seems to be a vendor-specific type defined by systems like

What are related issues/pull requests?

Tasklist

  • Review
  • Adjust for comments
  • All CI builds and checks have passed
    - Allow AppVeyor failure due to SQLite driver download issues
Remove non-standard constant SQL_NVARCHAR
- It is NOT a standard type defined in the ODBC Specification
- It was defined locally as SQL_NVARCHAR(-10)
- The same identifier value is reserved used by the ODBC standard
  for SQL_WLONGVARCHAR(-10)
- https://github.com/Microsoft/ODBC-Specification/blob/master/Windows/inc/sqlucode.h

It seems to be a vendor-specific type defined by systems like
- [HDBSQL and JDBC](http://hsqldb.org/doc/guide/guide.html)
- [OpenLink Virtuoso](http://docs.openlinksw.com/virtuoso/utf8notes4odbc/)
- [Open Database Transport Protocol](http://odbtp.sourceforge.net/)

@mloskot mloskot self-assigned this Feb 27, 2019

@mloskot mloskot requested a review from lexicalunit Feb 27, 2019

mloskot added a commit to mloskot/nanodbc that referenced this pull request Feb 27, 2019

Add support for SQL_WLONGVARCHAR data type
SQL Server, for example, reports
- `NTEXT` as `SQL_WLONGVARCHAR`
- `TEXT` as `SQL_LONGVARCHAR`

Formerly, `SQL_WLONGVARCHAR` column was only recognised by accident
due to defined `SQL_NVARCHAR(-10)` but the implementation was broken:
- `SQLDescribeCol` returns the column size of 1073741824 characters
- The column was not recognised as large variable-length object
- The column was also incorrectly recognised as `SQLCHAR`-based data
- Binding would attempt to pre-allocate large buffer of size
  `sizeof(SQLCHAR) * 1073741824`

Removal of the `SQL_NVARCHAR` proposed in nanodbc#210 - which is
a requirement of this changeset.

mloskot added a commit to mloskot/nanodbc that referenced this pull request Feb 27, 2019

Add support for SQL_WLONGVARCHAR data type
SQL Server, for example, reports
- `NTEXT` as `SQL_WLONGVARCHAR`
- `TEXT` as `SQL_LONGVARCHAR`

Formerly, `SQL_WLONGVARCHAR` column was only recognised by accident
due to defined `SQL_NVARCHAR(-10)` but the implementation was broken:
- `SQLDescribeCol` returns the column size of 1073741824 characters
- The column was not recognised as large variable-length object
- The column was also incorrectly recognised as `SQLCHAR`-based data
- Binding would attempt to pre-allocate large buffer of size
  `sizeof(SQLCHAR) * 1073741824`

Removal of the `SQL_NVARCHAR` proposed in nanodbc#210 - which is
a requirement of this changeset.

@mloskot mloskot referenced this pull request Feb 27, 2019

Merged

Add support for SQL_WLONGVARCHAR data type #211

4 of 4 tasks complete

@mloskot mloskot added this to the 2.13 milestone Feb 27, 2019

mloskot added a commit to mloskot/nanodbc that referenced this pull request Feb 27, 2019

Add support for SQL_WLONGVARCHAR data type
SQL Server, for example, reports
- `NTEXT` as `SQL_WLONGVARCHAR`
- `TEXT` as `SQL_LONGVARCHAR`

Formerly, `SQL_WLONGVARCHAR` column was only recognised by accident
due to defined non-standard `SQL_NVARCHAR(-10)` constant.
but the implementation was broken:
- `SQLDescribeCol` returns the column size of 1073741824 characters
- The column was not recognised as large variable-length object
- The column was also incorrectly recognised as `SQLCHAR`-based data
- Binding would attempt to pre-allocate large buffer of size
  `sizeof(SQLCHAR) * 1073741824`

Removal of the non-standard `SQL_NVARCHAR` proposed in nanodbc#210
- a requirement of this changeset.

mloskot added a commit to mloskot/nanodbc that referenced this pull request Feb 27, 2019

Add support for SQL_WLONGVARCHAR data type
SQL Server, for example, reports
- `NTEXT` as `SQL_WLONGVARCHAR`
- `TEXT` as `SQL_LONGVARCHAR`

Formerly, `SQL_WLONGVARCHAR` column was only recognised by accident
due to defined non-standard `SQL_NVARCHAR(-10)` constant but the
implementation was broken:
- `SQLDescribeCol` returns the column size of 1073741824 characters
- The column was not recognised as large variable-length object
- The column was also incorrectly recognised as `SQLCHAR`-based data
- Binding would attempt to pre-allocate large buffer of size
  `sizeof(SQLCHAR) * 1073741824`

Removal of the non-standard `SQL_NVARCHAR` proposed
in nanodbc#210 - a requirement of this changeset.

@mloskot mloskot merged commit b08d176 into nanodbc:master Mar 6, 2019

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mloskot mloskot added this to Done in Release 2.13 via automation Mar 6, 2019

@mloskot mloskot deleted the mloskot:ml/remove-sql-nvarchar-constant branch Mar 6, 2019

mloskot added a commit that referenced this pull request Mar 6, 2019

Add support for SQL_WLONGVARCHAR data type (#211)
SQL Server, for example, reports
- `NTEXT` as `SQL_WLONGVARCHAR`
- `TEXT` as `SQL_LONGVARCHAR`

Formerly, `SQL_WLONGVARCHAR` column was only recognised by accident
due to defined non-standard `SQL_NVARCHAR(-10)` constant but the
implementation was broken:
- `SQLDescribeCol` returns the column size of 1073741824 characters
- The column was not recognised as large variable-length object
- The column was also incorrectly recognised as `SQLCHAR`-based data
- Binding would attempt to pre-allocate large buffer of size
  `sizeof(SQLCHAR) * 1073741824`

Removal of the non-standard `SQL_NVARCHAR` proposed
in #210 - a requirement of this changeset.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.