Comments (7)
Can you describe you question more detailed, like this #63
from kingshard.
I use the beego orm lib which it's driver is mysql_driver.
sql:
_, err := o.Raw("SELECT t_project.f_id, t_project.f_cover_list, t_project.f_title FROM t_tag INNER JOIN t_project ON t_tag.f_entity_id = t_project.f_id WHERE t_tag.f_entity_type = 1 AND t_project.f_show_privilege = 3 AND t_tag.f_name = ? AND t_project.f_city = ? ORDER BY t_project.f_search_weight ASC, t_project.f_collect_count DESC LIMIT ?", tag, city, limit).ValuesList(&projectList)
table:
CREATE TABLE IF NOT EXISTS t_project (
f_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
f_title VARCHAR(100) NOT NULL COMMENT '标题',
f_tiny_title VARCHAR(100) DEFAULT '' COMMENT '小标题',
f_desc VARCHAR(500) COMMENT '一句话描述',
f_name VARCHAR(500) DEFAULT '' COMMENT '餐厅名称或者酒店名称',
f_city VARCHAR(100) NOT NULL COMMENT '适用城市',
f_big_type INT UNSIGNED NOT NULL DEFAULT '0' COMMENT '大类型,活动,酒店,餐厅',
f_type BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '小类型,以位运算来表示',
f_category_type INT UNSIGNED NOT NULL DEFAULT '0' COMMENT 'category,以位运算来表示',
f_category INT DEFAULT '0' COMMENT 'feed的分类0,1,3,4,5,6',
f_topic_id INT DEFAULT '0' COMMENT 'feed的话题Id',
f_category_desc VARCHAR(50) COMMENT '分类在APP上显示文字',
f_time_type TINYINT(3) UNSIGNED COMMENT '时间,包括当天,连续多天等',
f_time_json TEXT COMMENT '时间JSON字符串',
f_start_datetime VARCHAR(50) COMMENT '开始日期时间',
f_expire_datetime VARCHAR(50) COMMENT '结束日期时间',
f_price_type TINYINT(3) UNSIGNED COMMENT '价格类型,包括免费,打折,范围',
f_begin_price INT COMMENT '开始价格,根据type定义',
f_end_price INT COMMENT '结束价格,根据type定义',
f_tel VARCHAR(50) COMMENT '电话',
f_other_link VARCHAR(1024) COMMENT '外链',
f_link_url VARCHAR(1024) COMMENT '根据大类型决定,购买或者预订外链',
f_order_weight DECIMAL COMMENT '排序权重',
f_is_show TINYINT(3) COMMENT '是否展示',
f_show_privilege INT DEFAULT '1' COMMENT '显示权限,位表示',
f_project_digest TEXT COMMENT '详情摘要',
f_project_share_digest VARCHAR(200) COMMENT '详情分享出去的时候的摘要',
f_project_content TEXT COMMENT '详情内容',
f_supplier_type VARCHAR(100) DEFAULT 'self' COMMENT '供应商类型',
f_supplier_id VARCHAR(1024) DEFAULT '' COMMENT '供应商项目ID',
f_is_go TINYINT(3) UNSIGNED default '1' COMMENT '是否走起开关,0关,1开',
f_go_text VARCHAR(100) COMMENT '购票,预订等按钮文本',
f_collect_count INT UNSIGNED DEFAULT '0' COMMENT '收藏的人数,缓存到这个字段',
f_read_count INT UNSIGNED DEFAULT '0' COMMENT '阅读次数,缓存到这个字段',
f_reason_text VARCHAR(100) DEFAULT '' COMMENT '一句话理由',
f_share_url VARCHAR(1024) DEFAULT '' COMMENT '分享url',
f_cover_list TEXT DEFAULT '' COMMENT '图片数组',
f_search_weight INT UNSIGNED DEFAULT '0' COMMENT '搜索权重',
f_tags VARCHAR(1024) DEFAULT '' COMMENT 'project tags',
f_has_ambassador TINYINT(3) UNSIGNED default '0' COMMENT '是否活动大使',
f_brief_info TEXT COMMENT '简介信息',
f_attention TEXT COMMENT '活动须知',
f_lat VARCHAR(20) COMMENT '纬度',
f_lng VARCHAR(20) COMMENT '经度',
f_start_time VARCHAR(12) COMMENT '开始日期',
f_end_time VARCHAR(12) COMMENT '结束日期',
f_time_range TEXT COMMENT '离散时间点',
f_table_id VARCHAR(120) COMMENT '高德地图tableid',
f_row_id VARCHAR(20) COMMENT '高德地图tableid,中的rowid',
f_bus_id INT DEFAULT 0 COMMENT '点评地点ID',
f_bus_name VARCHAR(1024) DEFAULT '' COMMENT '点评地点名字',
f_editor_name VARCHAR(100) DEFAULT '' COMMENT '编辑者名称',
f_create_time TIMESTAMP default '0000-00-00 00:00:00' COMMENT '创建时间',
f_update_time TIMESTAMP default now() on update now() COMMENT '更新时间'
);
from kingshard.
It works when I hardcode LIMIT
value in sql.
from kingshard.
I receive several error Error 1105: invalid limit limit v2
today.
I found this error is issued by below snippet:
if o, ok := stmt.Limit.Rowcount.(sqlparser.NumVal); !ok {
return fmt.Errorf("invalid limit %s", nstring(stmt.Limit))
} else {
if count, err = strconv.ParseInt(hack.String([]byte(o)), 10, 64); err != nil {
return err
} else if count < 0 {
return fmt.Errorf("invalid limit %s", nstring(stmt.Limit))
}
}
When I pass limit number by parameter, this issue will happen,
o.Raw("SELECT * FROM t_project WHERE xxxx LIMIT ?", limit).ValuesList(&projectList)
But this will be fixed when I hardcode limit value in sql string
o.Raw("SELECT * FROM t_project WHERE xxxx LIMIT 1").ValuesList(&projectList)
I wanna to know limit v2
limit v3
is raise by Kingshard or any other side?
Your replay would be great appreciated.
from kingshard.
Thank you for your detailed description, as my daily work is much busy. I will check this bug on weekend.Please wait for several days. :)
from kingshard.
Fixed. As I have not installed beego, you can see if it works in this situation , and please reply the result to me. Thank you.
from kingshard.
Cool, thank you.
from kingshard.
Related Issues (20)
- this maybe append nil db to n.Slave[]
- error
- 单独的select * from table_xxx for update 语句应该配置一个选项来决定是否走主库查询
- 求一个完整的Dockerfile HOT 1
- 请问各位 分库分表情况下 这种SQL语句能执行吗
- 还维护吗?好久没更新了 HOT 2
- 读区mysql package递归替换迭代是否更优
- 请问节点和子表的对应关系可以配置吗
- hash方式分表分库分表时,如果key 是一个int64的值,只会达到第一个节点的第一个表上,请问这个该怎么修改 HOT 1
- 云服务器ping时出错 HOT 2
- timeout设置问题.
- 4年不更新了 HOT 1
- 这个好像好久不更新了 HOT 2
- When does kingshard support mysql8.0? My company now uses mysql8.0. HOT 1
- kingshard QQ群还活跃吗? HOT 1
- 谁能把这项目救活?
- 在用kingshard的活跃用户在这里登记一下吧,咱们一起交流交流 HOT 2
- SQLSTATE[HY000]: General error: 1105 command *sqlparser.Set not supported now HOT 1
- 分表问题 HOT 1
- KingshRd
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kingshard.