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

sql: unexpected numeric output on valid queries #7413

Closed
knz opened this issue Jun 22, 2016 · 3 comments
Closed

sql: unexpected numeric output on valid queries #7413

knz opened this issue Jun 22, 2016 · 3 comments

Comments

@knz
Copy link
Contributor

knz commented Jun 22, 2016

Found via #7409:

logic_test.go:863: /home/kena/go/src/github.com/cockroachdb/sqllogictest/test/random/expr/slt_good_2.test:6290:                                                                                                                                                                        expected:                 
         444077
 but found:
            442077
logic_test.go:863: /home/kena/go/src/github.com/cockroachdb/sqllogictest/test/random/expr/slt_good_2.test:28356:
        expected:
            -33
        but found:
            -49

logic_test.go:863: /home/kena/go/src/github.com/cockroachdb/sqllogictest/test/random/expr/slt_good_2.test:48936:
        expected:
            -7168

        but found:
            -9408

This should be investigated; the likely cause is that the division is not rounding the result. If that is confirmed, the sqllogictest input must be modified to add the necessary "skipif cockroachdb" directives.

@knz
Copy link
Contributor Author

knz commented Jun 22, 2016

One more:

 /home/kena/go/src/github.com/cockroachdb/sqllogictest/test/random/expr/slt_good_3.test:82676:

@maddyblue
Copy link
Contributor

This is indeed due to the division not rounding. See the simplified case:

SELECT 3 / 2 * 2;

On Postgres this outputs 2, on Cockroach 3.

I think this issue should be closed in favor of #7734.

@knz
Copy link
Contributor Author

knz commented Jul 13, 2016

Agreed.

@knz knz closed this as completed Jul 13, 2016
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