-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
non-cosmetic difference detected if semicolons present #4
Comments
You can see what's happening by looking at $ diff -u <(echo "select * from i" | pgpp -t) <(echo "select * from i;" | pgpp -t)
--- /dev/fd/63 2018-03-25 10:51:54.356248860 +0200
+++ /dev/fd/62 2018-03-25 10:51:54.356248860 +0200
@@ -32,7 +32,8 @@
}
]
}
- }
+ },
+ "stmt_len": 15
}
}
] I'll try to understand the meaning of that Thank you for reporting the issue! |
Here there is a brief explanation of the meaning of Also So yes, I think it's just a matter of removing it from the structure before comparison, as we already do for the location field. |
@lelit Just in case it helps, here is the full reference for the fingerprinting logic in pg_query itself: https://github.com/lfittl/libpg_query/wiki/Fingerprinting#version-20-based-on-postgresql-10 (the stmt_len is a Postgres 10 addition, and if I understand right I would ignore it for any comparisons between ASTs in your library as well) |
Thanks Lukas for the confirmation! |
I just release version 0.25 that fixes this. |
I get a non-cosmetic difference detected when I try and use
pgpp
on a file with eg the following contents:The same query, and other queries are fine without the semicolon.
What's happening here? Perhaps pgpp doesn't support multiple statements?
Happy to take a look at fixing if you'd like to point me in the right direction?
The text was updated successfully, but these errors were encountered: