Skip to content

Commit

Permalink
Merge pull request #30 from petergeoghegan/master
Browse files Browse the repository at this point in the history
Fix oversight in last commit
  • Loading branch information
amenonsen committed Aug 12, 2013
2 parents 174fde3 + a4972d8 commit 321a19e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions pg_stat_plans.c
Expand Up @@ -1381,16 +1381,13 @@ pg_stat_plans_explain(PG_FUNCTION_ARGS)

initStringInfo(&query);
appendStringInfo(&query, "EXPLAIN ");
if (!explain_sql_text)
{
/*
* Rely on this being NULL-terminated for us:
*/
appendBinaryStringInfo(&query, entry->query, entry->query_len);
/* Store query string */
explain_sql_text = palloc(query.len + 1);
strcpy(explain_sql_text, query.data);
}
/*
* Rely on this being NULL-terminated for us:
*/
appendBinaryStringInfo(&query, entry->query, entry->query_len);
/* Store query string */
explain_sql_text = palloc(query.len + 1);
strcpy(explain_sql_text, query.data);

LWLockRelease(pgsp->lock);

Expand Down
2 changes: 1 addition & 1 deletion tests/normalization_integration.py
Expand Up @@ -173,7 +173,7 @@ def main():
in some cases at some point in the code's development.
"""

conn = psycopg2.connect("")
conn = psycopg2.connect("host=localhost")
cur = conn.cursor()
cur.execute("set pg_stat_plans.track = 'all';")

Expand Down

0 comments on commit 321a19e

Please sign in to comment.