79198

重现步骤里有SQL语句导致保存失败

回帖
回帖数 4
阅读数 5503
发表时间 2010-07-24 13:22:45
含蓄的甜瓜楼主
重现步骤里添加有SQL语句后,出现保存失败,见下面日志[Sat Jul 24 08:58:34 2010] [error] [client 172.20.50.78] ERROR: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' order by B.SALE_QTY DESCrn3xe3x80x81xe6x9cx9fxe6x9cx9bxe7xbbx93xe6x9ex9cxefxbcx9axe5xb8x8cxe6x9cx9bxe8x83xbdxe5x9cxa8xe6xa8xa1xe5x9dx97xe8xaexbexe8xaexa1xe5x99xa8xe7x81' at line 1<p>The sql is: UPDATE zt_bug SET `title` = 'xe5x9fxbaxe7xb1xbbBUGxefxbcx8cxe4xbdxbfxe7x94xa8xe5x8fx8cxe8xa1xa8xe5xa4xb4xe7x9ax84xe6xa8xa1xe5x9dx97xe5xadx97xe6xaexb5xe6x97xa0xe6xb3x95xe6x8ex92xe5xbax8f',`steps` = '1xe3x80x81xe6xa8xa1xe5x9dx97xefxbcx9axe5xbax95xe6x96x99xe5xa4x87xe8xb4xa7xe9xa2x84xe6xb5x8brn2xe3x80x81xe9x9cx80xe8xa6x81xe6x8cx89xe7x85xa7xe9x94x80xe5x94xaexe6x95xb0xe9x87x8fSALE_QTYxe9x99x8dxe5xbax8fxe6x8ex92xe5xbax8fxefxbcx8cxe6xa8xa1xe5x9dx97xe8xaexbexe8xaexa1xe5x99xa8xe7x9ax84SQLxe8xafxadxe5x8fxa5xe5xb7xb2xe7xbbx8fxe5x86x99xe6x98x8exefxbcx8cxe4xbdx86xe6x98xafxe6x9fxa5xe8xafxa2xe6x95x88xe6x9ex9cxe8xbfx98xe6xb2xa1xe6x9cx89xe6x8cx89xe7x85xa7xe9x94x80xe5x94xaexe6x95xb0xe9x87x8fxe9x99x8dxe5xbax8fxe6x8ex92xe5xbax8frnselect A.*,coalesce(B.SALE_QTY,0) SALE_QTY from BH_DL_PREDATA Arnleft join BH_PRESHOEDATA BrnON A.YEARSON=B.YEARSON and A.BRAND=B.BRAND and A.ADDDATE=B.ADDDATrnand A.MPPOPN=B.MPPOPN and A.OAORTP=char(B.OAORTP)rn AND zt_bug.company = '1' order by B.SALE_QTY DESCrn3xe3x80x81xe6x9cx9fxe6x9cx9bxe7xbbx93xe6x9ex9cxefxbcx9axe5xb8x8cxe6x9cx9bxe8x83xbdxe5x9cxa8xe6xa8xa1xe5x9dx97xe8xaexbexe8xaexa1xe5x99xa8xe7x81xb5xe6xb4xbbxe5xa4x84xe7x90x86xe5x8fx8cxe8xa1xa8xe5xa4xb4xe5xadx97xe6xaexb5xe6x8ex92xe5xbax8fxe9x97xaexe9xa2x98xefxbcx8cxe8x80x8cxe4xb8x8dxe6x98xafxe5x9cxa8xe4xbbxa3xe7xa0x81xe9x87x8cxe5xaex9axe4xb9x89rn',`product` = '13',`module` = '0',`type` = 'designdefect',`severity` = '4',`pri` = '0',`status` = 'active',`assignedTo` = 'yanglei',`os` = 'all',`browser` = 'all',`keywords` = 'xe5x9fxbaxe7xb1xbbxefxbcx8cBUG',`project` = '0',`task` = '0',`openedBuild` = 'trunk',`resolvedBy` = '',`resolvedDate` = '',`resolvedBuild` = '',`resolution` = '',`duplicateBug` = '0',`closedBy` = '',`closedDate` = '',`mailto` = 'huanggw, zhengsf, ',`linkBug` = '',`case` = '0',`story` = '0',`lastEditedBy` = 'fangsy',`lastEditedDate` = '2010-07-24 08:58:34',`company` = '1' WHERE id = '19'</p> in E:zentaohomezentaolibdaodao.class.php on line 447, last called by E:zentaohomezentaomodulebugmodel.php on 136 through function exec., referer: http://172.20.30.86/zentao/bug-edit-19.html
4个回复
含蓄的甜瓜沙发
应该作为字符串来处理
2010-07-24 13:26:03 含蓄的甜瓜 回帖
🍟
春哥板凳
估计里面有sql的关键词,加上但双引号嵌套。你能把你的sql贴上来吗?
2010-07-25 07:55:00 王春生 回帖
含蓄的甜瓜#3
已经处理,有关键字order by
2010-07-26 13:25:28 含蓄的甜瓜 回帖
回头处理一下。:)
2010-07-26 15:36:48 王春生 回帖
联系我们
联系人
刘斌/高级客户经理
电话(微信)
17685869372
QQ号码
526288068
联系邮箱
liubin@chandao.com
相关帖子
返回顶部
客服头像
刘斌
高级客户经理
客服微信
17685869372
526288068
统一服务热线 4006-8899-23
我要提问提问有任何问题,您都可以在这里提问。问题反馈反馈点击这里,让我们聆听您的建议与反馈。