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

提问题BUG #5

Closed
wangjiazheng opened this issue Dec 25, 2017 · 1 comment
Closed

提问题BUG #5

wangjiazheng opened this issue Dec 25, 2017 · 1 comment

Comments

@wangjiazheng
Copy link

wangjiazheng commented Dec 25, 2017

作者你好,
经过我的调试,我发现mysql查询时,1.0.2以上的版本貌似没有考虑where部分是 date >= cast("2017-10-01" as date) 这种结构。
比如我这样写: date >= cast("2017-10-01" as date) and date <= cast("2017-10-31" as date)
那么就会出错了。

@wangjiazheng
Copy link
Author

wangjiazheng commented Dec 25, 2017

将1343、1344的两行:
$alias = $this->replaceName(substr($quoted, $pos + 4));
$quoted = substr($quoted, 0, $pos) . " AS $alias";
修改为如下:
$bracket = strripos($quoted, ')');
if ($bracket === false) {
$alias = $this->replaceName(substr($quoted, $pos + 4));
$quoted = substr($quoted, 0, $pos) . " AS $alias";
}
经测试是符合的。麻烦有空修复一下。

walkor added a commit that referenced this issue Dec 26, 2017
@walkor walkor closed this as completed Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants