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

4.0.0-RC1 join bug #3998

Closed
huweidada opened this issue Jan 16, 2020 · 4 comments
Closed

4.0.0-RC1 join bug #3998

huweidada opened this issue Jan 16, 2020 · 4 comments

Comments

@huweidada
Copy link

SELECT
COUNT(*)
FROM
sku_25
INNER JOIN sku_code_25
INNER JOIN sku_model_25
INNER JOIN model_25
INNER JOIN category_25
ON sku_25.id = sku_code_25.sku_id
AND sku_25.id = sku_model_25.sku_id
AND sku_model_25.model_id = model_25.id
AND model_25.category_id = category_25.id

 WHERE (  sku_25.owner_org_id = ?
            
        
          
              and sku_code_25.owner_org_id = ?
            
        
          
              and sku_model_25.owner_org_id = ?
            
        
          
              and model_25.owner_org_id = ?
            
        
          
              and category_25.owner_org_id = ?
            
        
          
              and sku.name like ? )
    
  
    
      or(  sku_25.owner_org_id = ?
            
        
          
              and sku_code_25.owner_org_id = ?
            
        
          
              and sku_model_25.owner_org_id = ?
            
        
          
              and model_25.owner_org_id = ?
            
        
          
              and category_25.owner_org_id = ?
            
        
          
              and sku_code.tenant_uuid_code like ? )

sku.name rewrite fail

@huweidada
Copy link
Author

SELECT
COUNT(*)
FROM
sku
INNER JOIN sku_code
INNER JOIN sku_model
INNER JOIN model
INNER JOIN category
ON sku.id = sku_code.sku_id
AND sku.id = sku_model.sku_id
AND sku_model.model_id = model.id
AND model.category_id = category.id

 WHERE (  sku.owner_org_id = ?
            
        
          
              and sku_code.owner_org_id = ?
            
        
          
              and sku_model.owner_org_id = ?
            
        
          
              and model.owner_org_id = ?
            
        
          
              and category.owner_org_id = ?
            
        
          
              and sku.name like ? )
    
  
    
      or(  sku.owner_org_id = ?
            
        
          
              and sku_code.owner_org_id = ?
            
        
          
              and sku_model.owner_org_id = ?
            
        
          
              and model.owner_org_id = ?
            
        
          
              and category.owner_org_id = ?
            
        
          
              and sku_code.tenant_uuid_code like ? )

@SteNicholas
Copy link
Member

@huweidada Please use the latest version to confirm this bug.

@huweidada
Copy link
Author

switch 4.0.0 version,the bug disappear.
thanks!
@SteNicholas

@SteNicholas
Copy link
Member

@huweidada welcome to make any use issue.

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

3 participants