Use a local variable instead of casting the address of a SQLSMALLINT
to a (size_t *). sizeof(SQLSMALLINT) < sizeof(size_t) so gcc is
rightfully giving the following errors when building on Fedora 34:
/usr/include/sqlucode.h: In function 'SQLErrorW':
odbc.c:130:20: error: array subscript 'size_t[0]' is partly outside array bounds of 'SQLSMALLINT[1]' [-Werror=array-bounds]
130 | size_t lin=*_lin, lout=*_lout;
| ^~~~~
odbc.c:974:21: note: while referencing 'pcbErrorMsg8'
974 | SQLSMALLINT pcbErrorMsg8;
| ^~~~~~~~~~~~
odbc.c:133:15: error: array subscript 'size_t[0]' is partly outside array bounds of 'SQLSMALLINT[1]' [-Werror=array-bounds]
133 | *_lin -= lin;
| ^~
odbc.c:974:21: note: while referencing 'pcbErrorMsg8'
974 | SQLSMALLINT pcbErrorMsg8;
| ^~~~~~~~~~~~
odbc.c:133:15: error: array subscript 'size_t[0]' is partly outside array bounds of 'SQLSMALLINT[1]' [-Werror=array-bounds]
133 | *_lin -= lin;
| ~~~~~~^~~~~~
odbc.c:974:21: note: while referencing 'pcbErrorMsg8'
974 | SQLSMALLINT pcbErrorMsg8;
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
* Add [brackets] around mdb-query table names
* Allow column and table names to be in brackets
Column and table names can have whitespace in them. The traditional way
to indicate that is with bracket characters, like so:
```sql
SELECT [column name] FROM [table name]
```
This change updates the parser to allow bracket format -- similar to
double-quoted format -- in all NAME contexts, i.e., column names, table
names, and database names.
Co-authored-by: Patrick Reynolds <patrick.reynolds@github.com>
`GFunc` is `void (gpointer, gpointer)` and `GHFunc` is `void (gpointer, gpointer, gpointer)`,
so the respective callback functions should have the same signature.
dont access pages in mdb_fetch_row when pdata is not initialized.
Happens when a client, e.g. pyodbc, queries for an unsupported type,
e.g. SQL_WVARCHAR, temp_table is empty and further access to it will crash.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff70fe3df in mdb_fetch_row (table=0xa74610) at data.c:467
467 rows = mdb_get_int16(
Backtrace:
0 0x00007ffff70fe3df in mdb_fetch_row (table=0xa74610) at data.c:467
1 0x00007ffff77f8746 in SQLFetch (hstmt=0xa70500) at odbc.c:1074
2 0x00007ffff7729b43 in SQLFetch () from /lib/x86_64-linux-gnu/libodbc.so.2
3 0x00007ffff778d545 in GetColumnSize (cnxn=0x7ffff77eb1f0, cnxn=0x7ffff77eb1f0, psize=0x7ffff77bde00, sqltype=-9) at src/cnxninfo.cpp:81
4 CnxnInfo_New (cnxn=0x7ffff77eb1f0) at src/cnxninfo.cpp:145
Signed-off-by: Ulrich Weber <ulrich.weber@gmail.com>
Per #260 I am assuming that the internal version 6 refers to files
created with Access 2019. I can't find any documentation on this format,
so I am calling it ACE17. Testing welcome.