4.2K Star 24K Fork 7K

GVP铭飞 / MCMS

 / 详情

静态化-生成主页失败(后台报错:语法错误)

已完成
创建于  
2020-02-18 13:36

我本地Mysql版本号:5.7.4

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT
  cms_content.id AS id,
  @rownum := @rownum + 1 AS `index`,
  LEFT (content_title, 40) AS title,
  content_title AS fulltitle,
  content_author AS author,
  content_source AS source,
  content_details AS content,
  category.category_title AS typename,
  category.category_id AS typeid,
  ( CASE category.category_img WHEN '' THEN category.category_img ELSE CONVERT ( JSON_UNQUOTE( JSON_EXTRACT( category.category_img -> '$[0]', '$.path' ) ) USING utf8 ) END ) AS typelitpic,
  (SELECT "index.html") AS typelink,
  ( CASE content_img WHEN '' THEN content_img ELSE CONVERT ( JSON_UNQUOTE( JSON_EXTRACT( content_img -> '$[0]', '$.path' ) ) USING utf8 ) END ) AS litpic,

  CONCAT(category.category_path,"/",cms_content.id,".html") AS link,
  content_datetime AS date,
  content_description AS descrip,
  content_hit AS hit,
  content_type AS flag,
  category_title AS typetitle,
  cms_content.content_keyword AS keyword 
FROM
  (SELECT @rownum := 0) r,
  cms_content
  LEFT JOIN cms_category as category ON content_category_id = category.id
  
WHERE  
  content_display=0 
    and cms_content.app_id=1
	and cms_content.id>0
     and (content_category_id=149 or content_category_id in 
  (select id FROM cms_category where cms_category.del=0 and find_in_set(149,CATEGORY_PARENT_ID))) 
    ORDER BY   cms_content.id
   LIMIT 
  6]; nested exception is java.sql.SQLSyntaxErrorException: 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 '> '$[0]', '$.path' ) ) USING utf8 ) END ) AS typelitpic,
  (SELECT "index.html"' at line 11

评论 (3)

xw 创建了任务
xw 关联仓库设置为铭飞/MCMS
展开全部操作日志

同问,你解决了吗,怎么解决的

我这里测试的情况是不兼容MariaDB,Mysql55也不行,只能用Mysql57,我还是用的最新的版本5.7.29这里才没报错。建议作者把sql代码写通用点,连MariaDB都不能兼容很不方便部署

我也遇到这个问题,怎么解决?
用的数据库是maria db

铭飞 里程碑设置为5.0.1
铭飞 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(4)
1833987 restart crush 1582161472 421998  .wendy 1581064823
Java
1
https://gitee.com/mingSoft/MCMS.git
git@gitee.com:mingSoft/MCMS.git
mingSoft
MCMS
MCMS

搜索帮助

344bd9b3 5694891 D2dac590 5694891