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

Strange selection for composed keys #91

Open
tz-lom opened this issue May 19, 2013 · 2 comments
Open

Strange selection for composed keys #91

tz-lom opened this issue May 19, 2013 · 2 comments

Comments

@tz-lom
Copy link

tz-lom commented May 19, 2013

For examle, lets take simple table

CREATE TABLE `read2` (
  `k1` int(11) NOT NULL,
  `k2` int(11) NOT NULL,
  `v` varchar(40) NOT NULL,
  PRIMARY KEY (`k1`,`k2`)
)
SELECT * FROM read2;
+----+----+----+
| k1 | k2 | v  |
+----+----+----+
|  1 |  1 | A1 |
|  1 |  2 | A2 |
|  1 |  3 | A3 |
|  2 |  1 | B1 |
|  2 |  2 | B2 |
|  2 |  3 | B3 |
|  3 |  1 | C1 |
|  3 |  2 | C2 |
|  3 |  3 | C3 |
+----+----+----+

now, do some selection with comparasions k1>2 k2>1

P       1       HSPHP_test      read2   PRIMARY v
0       1
1       >       2       2       1       10
0       1       B2      B3      C1      C2      C3

Now, I can't understand how comparisons work

  • it isn't k1>2 OR k2>1, because A3 is not in list
  • it isn't k1>2 AND k2>1, because B2 in list

so, how comparisons for composed keys work, is it bug or feature?

@tz-lom
Copy link
Author

tz-lom commented May 26, 2013

If it possible, please answer is it a bug or not. If it is, I will try to fix it.

@ahiguti
Copy link
Contributor

ahiguti commented Mar 25, 2015

it's not a bug!

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

No branches or pull requests

2 participants