MySQL++

Artifact [0126570deb]
Login

Artifact 0126570deb9f9e06ec9af516c7f65f3ca4aae8ab69ca827eddc51dfaba7f6af9:

Ticket change [0126570deb] - New ticket [e6cf4b6fbb4b8cea|e6cf4b6fbb] <i>Errors not checked when fetch_row returns NULL</i>. by anonymous 2019-10-25 23:16:29.
D 2019-10-25T23:16:29.897
J foundin 3.2.4
J icomment In\sUseQueryResult::fetch_row\sand\sStoreQueryResult::StoreQueryResult,\swhen\r\nDBDriver::fetch_row\sreturns\sNULL\sit\sis\sassumed\sto\smean\sthere\sare\sno\smore\r\nrows.\sDBDriver::fetch_row\scan\salso\sreturn\sNULL\swhen\sthere\sare\serror\r\nconditions\s(such\sas\sthe\sconnection\sbeing\sdropped\swhile\siterating),\sand\syet\r\nno\sexception\sis\sthrown\swhen\sthey\sare\senabled.\sThis\scan\sresult\sin\sincomplete\r\nresult\ssets\sif\sthe\serror\sstate\sis\snot\schecked\simmediately\safter\sthe\squery\r\ncompleted,\swhich\sis\sprobably\sunexpected\sbehaviour?\r\n\r\nWe've\sfixed\sthis\swith\sthe\sfollowing\spatch:\r\n\r\n---\smysql++-3.2.4/lib/result.cpp\t2019-07-21\s04:32:30.000000000\s-0700\r\n+++\smysql++-3.2.4/lib/result_new.cpp\t2019-10-25\s15:38:30.659424092\s-0700\r\n@@\s-110,8\s+110,10\s@@\r\n\s\t\t\t\t++it;\r\n\s\t\t\t}\r\n\s\t\t}\r\n-\r\n\s\t\tdbd->free_result(res);\r\n+\t\tif\s(throw_exceptions()\s&&\sdbd->errnum()\s!=\s0)\s{\r\n+\t\t\tthrow\sUseQueryError(dbd->error());\r\n+\t\t}\r\n\s\t}\r\n\s}\r\n\s\r\n@@\s-190,6\s+192,9\s@@\r\n\s\t\t}\r\n\s\t}\r\n\s\telse\s{\r\n+\t\tif\s(throw_exceptions()\s&&\sdriver_->errnum()\s!=\s0)\s{\r\n+\t\t\tthrow\sUseQueryError(driver_->error());\r\n+\t\t}\r\n\s\t\t//\sPrior\sto\sv3,\sthis\swas\sconsidered\san\serror,\sbut\sit\sjust\smeans\r\n\s\t\t//\swe've\sfallen\soff\sthe\send\sof\sa\s"use"\squery's\sresult\sset.\s\sYou\r\n\s\t\t//\scan't\spredict\swhen\sthis\swill\shappen,\sbut\sit\sisn't\san\serror.
J login anonymous
J mimetype text/x-fossil-plain
J private_contact 1edb4d11c026a98bf7e4d75966de07849a19965d
J severity Minor
J status Open
J title Errors\snot\schecked\swhen\sfetch_row\sreturns\sNULL
J type Code\sDefect
K e6cf4b6fbb4b8ceab208f45bb0ecd599f120ea64
U anonymous
Z 76bdbf7b4a009c7ae51a33cf9b690229