Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
1.0.6
Environment:
ubuntu 20.04
python latest
mariadb server latest
Hello,
I have a quite obvious bug to report:
I have a table row that looks like this:
id title category date_posted date_due content file user_id
6 test 7 10 2021-04-01 21:50:21 content 7 strawsf9cdaf.txt 16
The problem is that i have a DATETIME field that is NULL (the date_due date is not mandatory in my app)
It seems that after passing values to the execute() method, the fetchall() method parses returned data differently.
First case works great Second returns the "ValueError: year 0 is out of range"
id = ( "6" ,)
statement1 = "select * from posts where id = 6"
statement2 = "select * from posts where id = ?"
db.cursor.execute(statement1)
result = db.cursor.fetchall()
for x in result:
print (x)
db.cursor.execute(statement2, id )
result = db.cursor.fetchall()
for x in result:
print (x)
I tried to list() the connector - same result
I tried to change values and table column attributes - same result
I though its a problem of versions so i updated to latest python, mariadb server and python connector (on ubuntu 20.04)- same result
The result:
6, 'test 7', 10, datetime.datetime(2021, 4, 1, 21, 50, 21), None, 'content 7', 'strawsf9cdaf.txt', 16)
ValueError: year 0 is out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/project dir/main_test3.py", line 38, in <module>
result = db.cursor.fetchall()
SystemError: <method 'fetchall' of 'mariadb.connection.cursor' objects> returned a result with an error set
Process finished with exit code 1
I posted the issue for easy reading also to stackoverflow:
https://stackoverflow.com/questions/66963588/python-mariadb-connector-error-when-fetching-results-from-a-datetime-with-value
{"report":{"fcp":772.2999999523163,"ttfb":166.59999990463257,"pageVisibility":"visible","entityId":98555,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"b1859f95-4887-491e-b05d-62ded7456ba3","navigationType":0,"readyForUser":844.2999999523163,"redirectCount":0,"resourceLoadedEnd":511.89999985694885,"resourceLoadedStart":175.29999995231628,"resourceTiming":[{"duration":4.099999904632568,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":175.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":175.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":179.39999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":4.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":175.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":175.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":180,"responseStart":0,"secureConnectionStart":0},{"duration":217.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":175.5,"connectEnd":182.39999985694885,"connectStart":182.39999985694885,"domainLookupEnd":182.39999985694885,"domainLookupStart":182.39999985694885,"fetchStart":175.5,"redirectEnd":0,"redirectStart":0,"requestStart":182.79999995231628,"responseEnd":393.09999990463257,"responseStart":197.29999995231628,"secureConnectionStart":182.39999985694885},{"duration":336.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":175.69999980926514,"connectEnd":175.69999980926514,"connectStart":175.69999980926514,"domainLookupEnd":175.69999980926514,"domainLookupStart":175.69999980926514,"fetchStart":175.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":183.39999985694885,"responseEnd":511.89999985694885,"responseStart":213.5,"secureConnectionStart":175.69999980926514},{"duration":39.299999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":175.79999995231628,"connectEnd":175.79999995231628,"connectStart":175.79999995231628,"domainLookupEnd":175.79999995231628,"domainLookupStart":175.79999995231628,"fetchStart":175.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":183.79999995231628,"responseEnd":215.09999990463257,"responseStart":207.29999995231628,"secureConnectionStart":175.79999995231628},{"duration":41.700000047683716,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":175.89999985694885,"connectEnd":175.89999985694885,"connectStart":175.89999985694885,"domainLookupEnd":175.89999985694885,"domainLookupStart":175.89999985694885,"fetchStart":175.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":184.19999980926514,"responseEnd":217.59999990463257,"responseStart":211,"secureConnectionStart":175.89999985694885},{"duration":9,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":176,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":176,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":185,"responseStart":0,"secureConnectionStart":0},{"duration":39.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":176,"connectEnd":176,"connectStart":176,"domainLookupEnd":176,"domainLookupStart":176,"fetchStart":176,"redirectEnd":0,"redirectStart":0,"requestStart":185.19999980926514,"responseEnd":215.69999980926514,"responseStart":209.09999990463257,"secureConnectionStart":176},{"duration":40,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":176.19999980926514,"connectEnd":176.19999980926514,"connectStart":176.19999980926514,"domainLookupEnd":176.19999980926514,"domainLookupStart":176.19999980926514,"fetchStart":176.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":187.79999995231628,"responseEnd":216.19999980926514,"responseStart":210,"secureConnectionStart":176.19999980926514},{"duration":9.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":176.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":176.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":186.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":44.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":176.39999985694885,"connectEnd":176.39999985694885,"connectStart":176.39999985694885,"domainLookupEnd":176.39999985694885,"domainLookupStart":176.39999985694885,"fetchStart":176.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":189.69999980926514,"responseEnd":220.5,"responseStart":216.59999990463257,"secureConnectionStart":176.39999985694885},{"duration":327.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":183.09999990463257,"connectEnd":183.09999990463257,"connectStart":183.09999990463257,"domainLookupEnd":183.09999990463257,"domainLookupStart":183.09999990463257,"fetchStart":183.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":206.79999995231628,"responseEnd":510.7999999523163,"responseStart":503,"secureConnectionStart":183.09999990463257},{"duration":327.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":183.5,"connectEnd":183.5,"connectStart":183.5,"domainLookupEnd":183.5,"domainLookupStart":183.5,"fetchStart":183.5,"redirectEnd":0,"redirectStart":0,"requestStart":220.09999990463257,"responseEnd":511.2999999523163,"responseStart":504.59999990463257,"secureConnectionStart":183.5},{"duration":128.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":535.8999998569489,"connectEnd":535.8999998569489,"connectStart":535.8999998569489,"domainLookupEnd":535.8999998569489,"domainLookupStart":535.8999998569489,"fetchStart":535.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":624.3999998569489,"responseEnd":664.5999999046326,"responseStart":662.3999998569489,"secureConnectionStart":535.8999998569489},{"duration":130.40000009536743,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":765.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":765.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":896,"responseStart":0,"secureConnectionStart":0},{"duration":160.29999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":772.2999999523163,"connectEnd":772.2999999523163,"connectStart":772.2999999523163,"domainLookupEnd":772.2999999523163,"domainLookupStart":772.2999999523163,"fetchStart":772.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":899.6999998092651,"responseEnd":932.5999999046326,"responseStart":931.5999999046326,"secureConnectionStart":772.2999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":16,"responseStart":166,"responseEnd":183,"domLoading":170,"domInteractive":938,"domContentLoadedEventStart":938,"domContentLoadedEventEnd":979,"domComplete":1883,"loadEventStart":1883,"loadEventEnd":1884,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":912.7999999523163},{"name":"bigPipe.sidebar-id.end","time":913.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":913.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":916},{"name":"activityTabFullyLoaded","time":989.7999999523163}],"measures":[],"correlationId":"854e10a7da4520","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":76,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}