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

2010-07-24 13:22:45
含蓄的甜瓜
  • 访问次数: 14
  • 注册日期: 2010-07-08
  • 最后登录: 2010-07-31
  • 我的积分: 132
  • 门派等级: 玄清 等级1 居士
重现步骤里添加有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
沙发
2010-07-24 13:26:03
含蓄的甜瓜
  • 访问次数: 14
  • 注册日期: 2010-07-08
  • 最后登录: 2010-07-31
  • 我的积分: 132
  • 门派等级: 玄清 等级1 居士
应该作为字符串来处理
板凳
2010-07-25 07:55:00
春哥
  • 访问次数: 10795
  • 注册日期: 2005-04-30
  • 最后登录: 2024-04-12
  • 我的积分: 530139
  • 门派等级: 幽灵 等级7 春哥
估计里面有sql的关键词,加上但双引号嵌套。你能把你的sql贴上来吗?
#3
2010-07-26 13:25:28
含蓄的甜瓜
  • 访问次数: 14
  • 注册日期: 2010-07-08
  • 最后登录: 2010-07-31
  • 我的积分: 132
  • 门派等级: 玄清 等级1 居士
已经处理,有关键字order by
#4
2010-07-26 15:36:48
春哥
  • 访问次数: 10795
  • 注册日期: 2005-04-30
  • 最后登录: 2024-04-12
  • 我的积分: 530139
  • 门派等级: 幽灵 等级7 春哥
回头处理一下。:)
1/1 1