quote any variable usages in SQL
This commit is contained in:
@ -373,7 +373,7 @@ class SelectSQLRewriter extends AbstractSQLRewriter
|
|||||||
INNER JOIN
|
INNER JOIN
|
||||||
pg_stat_user_tables S ON (S.relid = C.oid)
|
pg_stat_user_tables S ON (S.relid = C.oid)
|
||||||
WHERE
|
WHERE
|
||||||
N.nspname = $schema AND
|
N.nspname = '$schema' AND
|
||||||
C.relname IN ('wp_comments','wp_options','wp_posts','wp_terms','wp_users')
|
C.relname IN ('wp_comments','wp_options','wp_posts','wp_terms','wp_users')
|
||||||
GROUP BY
|
GROUP BY
|
||||||
C.relname, pg_total_relation_size(C.oid), S.n_live_tup;
|
C.relname, pg_total_relation_size(C.oid), S.n_live_tup;
|
||||||
|
@ -42,9 +42,9 @@ class ShowTableStatusSQLRewriter extends AbstractSQLRewriter
|
|||||||
pg_namespace nsp ON cls.relnamespace = nsp.oid
|
pg_namespace nsp ON cls.relnamespace = nsp.oid
|
||||||
WHERE
|
WHERE
|
||||||
cls.relkind = 'r'
|
cls.relkind = 'r'
|
||||||
AND nsp.nspname NOT LIKE 'pg_%' -- Ignore schemas with names starting with pg_
|
AND nsp.nspname NOT LIKE 'pg_%'
|
||||||
AND nsp.nspname != 'information_schema' -- Ignore the information_schema
|
AND nsp.nspname != 'information_schema'
|
||||||
AND nsp.nspname = $schema -- Select only tables in the 'myschema' schema
|
AND nsp.nspname = '$schema'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
cls.relname ASC;
|
cls.relname ASC;
|
||||||
SQL;
|
SQL;
|
||||||
|
Reference in New Issue
Block a user