tberthel / jiql

Automatically exported from code.google.com/p/jiql
0 stars 0 forks source link

wrong value after JOIN #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
- What steps will reproduce the problem?

1. Follow the example "10)Enter the following SQL statements to ALTER with 
FOREIGN KEYS tables" in "jiql.jsp"

2. I have these data in two tables:
[realm_user]
    realm_passphrase     realm_username
    tigres   ruser1
    tigres   ruser2
[realm_userrole]
    realm_rolename   realm_user
    role2    ruser1
    role2    ruser2
    role1    ruser1

3. And get wrong result when execute SQL "select t1.*,t2.* from realm_userrole 
t1 , realm_user t2 where t1.realm_user=t2.realm_username and 
realm_user='ruser1'":

    t1.realm_user   t1.realm_rolename   t2.realm_username   t2.realm_passphrase
    ruser1  role2   ruser1  tigres
    ruser1  role2   ruser1  tigres

- What is the expected output? What do you see instead?

Expected result should be:

    t1.realm_user   t1.realm_rolename   t2.realm_username   t2.realm_passphrase
    ruser1  role1   ruser1  tigres
    ruser1  role2   ruser1  tigres

Original issue reported on code.google.com by randy...@gmail.com on 21 Dec 2012 at 10:01