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

Query API with multiple conditions might return wrong result #98

Closed
youyk opened this issue Aug 16, 2015 · 2 comments
Closed

Query API with multiple conditions might return wrong result #98

youyk opened this issue Aug 16, 2015 · 2 comments
Labels

Comments

@youyk
Copy link
Contributor

youyk commented Aug 16, 2015

Test environment:
1, 0.9 upsteam
2, management l3 and public l3 share same public l3
3, public l3 is not system l3 and has DHCP and DNS services
4, there are other private l3 and has SNAT services, which will create VRs.

reproduce step:

  1. create private l3 vms and public l3 vm, this will create a serial of VR VMS.
  2. in zstack-cli, query VR (applianceVm) which using l3=public_l3_uuid as private l3, but not only public l3.
    3, if the query api is like following line, the return result is just 1 VR (public l3 VR).
    QueryApplianceVm vmNics.l3NetworkUuid?=95b46bc1a8fe4ffdac5638d20f0a8764 vmNics.metaData!=3 vmNics.metaData!=2 vmNics.metaData!=1
    4, but if the query api is like following line, the return result includes 3 VRs.
    QueryApplianceVm vmNics.l3NetworkUuid?=95b46bc1a8fe4ffdac5638d20f0a8764 vmNics.metaData!=1 vmNics.metaData!=2 vmNics.metaData!=3
@youyk youyk added the bug label Aug 16, 2015
@youyk
Copy link
Contributor Author

youyk commented Aug 16, 2015

After tracking mysql.log, this issue should be a bug in query api code:
If the condition key is same, the query API will use the 1st data number, no matter how many data numbers are provided:
where (vmnicvo1_.l3NetworkUuid in ('90cd54d7d69a4a0cbb58c3cc9c9bdef0')) and vmnicvo1_.metaData<>'3' and vmnicvo1_.metaData<>'3' and vmnicvo1_.metaData<>'3') limit 1000

@zxwing
Copy link
Contributor

zxwing commented Aug 22, 2015

fixed in 752cccd

@zxwing zxwing closed this as completed Aug 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants