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

Function INSERT should be NULL if any argument is NULL #11174

Closed
SunRunAway opened this issue Jul 10, 2019 · 0 comments · Fixed by #11237
Closed

Function INSERT should be NULL if any argument is NULL #11174

SunRunAway opened this issue Jul 10, 2019 · 0 comments · Fixed by #11237
Labels
component/expression help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug.

Comments

@SunRunAway
Copy link
Contributor

SunRunAway commented Jul 10, 2019

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
SELECT INSERT(0.0024912753641791164, 0.00000000000000000000, 1, NULL);
  1. What did you expect to see?

Due to https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_insert,

Returns NULL if any argument is NULL.

mysql> SELECT INSERT(0.0024912753641791164, 0.00000000000000000000, 1, NULL);
+----------------------------------------------------------------+
| INSERT(0.0024912753641791164, 0.00000000000000000000, 1, NULL) |
+----------------------------------------------------------------+
| NULL                                                           |
+----------------------------------------------------------------+
1 row in set (0.00 sec)
  1. What did you see instead?
mysql> SELECT INSERT(0.0024912753641791164, 0.00000000000000000000, 1, NULL);
+----------------------------------------------------------------+
| INSERT(0.0024912753641791164, 0.00000000000000000000, 1, NULL) |
+----------------------------------------------------------------+
| 0.0024912753641791164                                          |
+----------------------------------------------------------------+
1 row in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    fdbc149
@SunRunAway SunRunAway added type/bug The issue is confirmed as a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. component/expression and removed component/expression labels Jul 10, 2019
@SunRunAway SunRunAway added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant