Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql执行正常但是com.alibaba.druid.sql.parser.ParserException #2593

Closed
ghost opened this issue May 24, 2018 · 1 comment
Closed

mysql执行正常但是com.alibaba.druid.sql.parser.ParserException #2593

ghost opened this issue May 24, 2018 · 1 comment
Labels
Milestone

Comments

@ghost
Copy link

ghost commented May 24, 2018

我的Sql:

select
product.brand_id,
product.lang_id,
product.product_id,
product.url_key,
product.model,
product.sku,
product.asin,
product.product_name,
product.short_name,
product.product_img,
product.status,
product.title,
product.keywords,
product.seo_desc,
product.description,
product.more_color,
product.master_color,
product.hot_flag,
product.new_flag,
product.deals_flag,
product.amz_desc,
product.amz_keywords,
product.amz_reviews,
product.amz_avg_star,
product.abtest,
product.sort,
product.old_product_id,
product.old_url_key,
categoryProduct.category_id
from catalog_product as product, catalog_category_product as categoryProduct
where product.brand_id = categoryProduct.brand_id and product.lang_id = categoryProduct.lang_id and
product.product_id = categoryProduct.product_id and product.brand_id = ? and product.lang_id = ? and
categoryProduct.category_id = ? and product.status = 1 and
product.more_color between (0 AND 1) and product.master_color = 1
order by product.sort asc

报错:
com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'duct.master_color = 1 order by prod',expect EQ, actual EQ master_color

原因:between (0 AND 1)
between 0 AND 1 不带括号查询差别很大

@wenshao wenshao added the Bug label May 25, 2018
@wenshao wenshao added this to the 1.1.10 milestone May 25, 2018
@wenshao
Copy link
Member

wenshao commented May 27, 2018

https://github.com/alibaba/druid/releases/tag/1.1.10
问题修复,请用新版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant