Pattern
SQL Identity and Scope Mismatch
sql-identity-scope-mismatch
Database logic fails when identity and filtering scope are defined inconsistently—e.g., auth tenant vs organization, ids vs composite partition keys, or inner vs outer predicates—causing incorrect row selection, missed matches, and DBMS-dependent behavior.