Fix: Escape literal % in LIKE pattern in B1 metadata diagnostic
psycopg2 performs %-substitution when params are passed to execute(), so 'M%' in the LIKE clause was being interpreted as a positional placeholder, raising IndexError when there's only one real %s (LIMIT). Escape as 'M%%' so it's preserved as a literal percent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
23bcc057c5
commit
3c69e7545a
1 changed files with 1 additions and 1 deletions
|
|
@ -55,7 +55,7 @@ def main():
|
|||
cursor.execute("""
|
||||
SELECT tracking_id, original_filename, full_metadata
|
||||
FROM master_assets
|
||||
WHERE tracking_id LIKE 'M%'
|
||||
WHERE tracking_id LIKE 'M%%'
|
||||
AND local_campaign_id IS NULL
|
||||
AND status = 'active'
|
||||
ORDER BY created_at DESC
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue