-
Notifications
You must be signed in to change notification settings - Fork 72
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
this gonna take long... #29
Open
braian87b
wants to merge
17
commits into
jiangwen365:master
Choose a base branch
from
braian87b:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add support for es_ES dates
NamedTupleRow and MutableNamedTupleRow depend on _ColBufferList being populated, so without this change they do not work.
This is consistent with pyodbc.
I think out-of-the-box compatibility with pyodbc is a worthy goal. I understand not wanting a hard dependency on 'recordtype' but at least providing read-only named field access seems like an improvement.
I've run into memory corruption bugs with the following test program on 64-bit Linux, sizeof(wchar_t) == 4, sizeof(Py_UNICODE) == 4, sizeof(SQLWCHAR) == 2. from pypyodbc import connect # Replace '...' with real values conn_string = 'DRIVER={SQL Server};SERVER=...;PORT=1433;UID=...;PWD=...;TDS_Version=7.1;APP=...;DATABASE=...' while True: connect(conn_string, ansi=False) For me this typically causes libc to abort() complaining of memory corruption, double-free, etc. within a few tens of iterations with cpython (and quicker with pypy). The bug seems to be in the conversion from Python string to SQLWCHAR * when calling SQLDriverConnectW. Given the sizes above, pypyodbc sets wchar_pointer = ctypes.c_char_p, then passes a UTF-16-encoded byte buffer to it. ctypes.c_char_p null-terminates the string when converting to a C array - but it only adds a single NUL byte. unixODBC expects that argument to be a UTF-16 array, terminated by two NUL bytes. This fix is a bit of a hack, but it does work. It might be clearer to define something akin to c_char_p for these arguments, I suppose.
compact db - support for password protected db, allow space within da…
Add support for es_ES dates
Fix for issue jiangwen365#45 on Google Code
Change length of state buffer from 22 to 24 bytes.
Raise OperationalError for ConnectionWrite error
quick fix for issue58
Fix unicode buffer length
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.