djhenderson / pymssql

Automatically exported from code.google.com/p/pymssql
GNU Lesser General Public License v2.1
0 stars 0 forks source link

datetime conversion to sql is not converting sub-seconds correctly #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When converting a python datetime to SQL, the sub-seconds are being converted 
incorrectly.  If the datetime microseconds value is 10000, it will be treated 
as 100000 in SQL because the conversion doesn't prepend leading zeroes.

What steps will reproduce the problem?
See attached test.  But basically I expect to send a datetime to SQL Server and 
receive the same datetime back (accounting for precision and rounding 
differences).

What is the expected output? What do you see instead?
See attached test.

What version of the product are you using? On what operating system?
2.0.0b1, Ubuntu 12.04

Please provide any additional information below.
Patch attached.

Original issue reported on code.google.com by kenneth....@gmail.com on 15 Mar 2013 at 6:42

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by msabr...@gmail.com on 3 Apr 2013 at 5:48

GoogleCodeExporter commented 9 years ago
Fixed with 
https://code.google.com/p/pymssql/source/detail?r=5d0c980ef8b89a9d95d7383e242c60
3c2948caf9

Thanks, Ken!

Original comment by msabr...@gmail.com on 3 Apr 2013 at 5:59

GoogleCodeExporter commented 9 years ago

Original comment by msabr...@gmail.com on 3 Apr 2013 at 5:59

GoogleCodeExporter commented 9 years ago
pymssql-2.0.0b1-dev-20130403.tar.gz at 
https://code.google.com/p/pymssql/downloads/list has this change. Ken, can you 
verify that it works?

Original comment by msabr...@gmail.com on 3 Apr 2013 at 7:21

GoogleCodeExporter commented 9 years ago
My test works.  Looks good to me.  Thanks!

Original comment by kenneth....@gmail.com on 3 Apr 2013 at 7:35