pg_query 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/ext/pg_query/extconf.rb +1 -1
- data/ext/pg_query/pg_query_ruby.c +1 -1
- data/lib/pg_query/parse.rb +12 -1
- data/lib/pg_query/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a4724c7ac9b16756c258b015aa4576da20258c0b3beff05d65fcead44b9ba63
|
4
|
+
data.tar.gz: 8513d20ca3bfc1f14301b3d7e473b45f5d3234e3ddb03a06213c040b74b236cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1be0d5b046bc54c26c223d2114371f93ff7fdb12376518c109cebee009d1a61a4883ef12e07e7692c20668b000db2ece079f9c76204edf497a476b3f83271854
|
7
|
+
data.tar.gz: 024e2a9cb8be13b5f4885dbae15a6c2481d0fde469de0d82ca8040dc951fa58ef2780a0b849fc8092faf608fa5404886576af5c2759b03b86f92069d7d4d230b
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,18 @@
|
|
4
4
|
|
5
5
|
* ...
|
6
6
|
|
7
|
+
|
8
|
+
## 2.1.2 2021-11-12
|
9
|
+
|
10
|
+
* Find tables in using clause of delete statement ([#234](https://github.com/pganalyze/pg_query/pull/234))
|
11
|
+
* Find tables in case statements ([#235](https://github.com/pganalyze/pg_query/pull/235))
|
12
|
+
* Correctly find nested tables in a subselect in a join condition ([#233](https://github.com/pganalyze/pg_query/pull/233))
|
13
|
+
* Mark Postgres methods as visibility hidden, to avoid bloating dynamic symbol table ([#232](https://github.com/pganalyze/pg_query/pull/232))
|
14
|
+
- This is required on ELF platforms (i.e. Linux, etc) to avoid including all global
|
15
|
+
symbols in the shared library's symbol table, bloating the size, and causing
|
16
|
+
potential conflicts with other C libraries using the same symbol names.
|
17
|
+
|
18
|
+
|
7
19
|
## 2.1.1 2021-10-13
|
8
20
|
|
9
21
|
* Update to libpg_query 13-2.1.0 ([#230](https://github.com/pganalyze/pg_query/pull/230))
|
data/ext/pg_query/extconf.rb
CHANGED
@@ -7,7 +7,7 @@ require 'pathname'
|
|
7
7
|
|
8
8
|
$objs = Dir.glob(File.join(__dir__, '*.c')).map { |f| Pathname.new(f).sub_ext('.o').to_s }
|
9
9
|
|
10
|
-
$CFLAGS << " -O3 -Wall -fno-strict-aliasing -fwrapv -fstack-protector -Wno-unused-function -Wno-unused-variable -g"
|
10
|
+
$CFLAGS << " -fvisibility=hidden -O3 -Wall -fno-strict-aliasing -fwrapv -fstack-protector -Wno-unused-function -Wno-unused-variable -Wno-clobbered -Wno-sign-compare -Wno-discarded-qualifiers -g"
|
11
11
|
|
12
12
|
$INCFLAGS = "-I#{File.join(__dir__, 'include')} " + $INCFLAGS
|
13
13
|
|
@@ -14,7 +14,7 @@ VALUE pg_query_ruby_fingerprint(VALUE self, VALUE input);
|
|
14
14
|
VALUE pg_query_ruby_scan(VALUE self, VALUE input);
|
15
15
|
VALUE pg_query_ruby_hash_xxh3_64(VALUE self, VALUE input, VALUE seed);
|
16
16
|
|
17
|
-
void Init_pg_query(void)
|
17
|
+
__attribute__((visibility ("default"))) void Init_pg_query(void)
|
18
18
|
{
|
19
19
|
VALUE cPgQuery;
|
20
20
|
|
data/lib/pg_query/parse.rb
CHANGED
@@ -149,6 +149,12 @@ module PgQuery
|
|
149
149
|
subselect_items << statement.update_stmt.where_clause if statement.node == :update_stmt && statement.update_stmt.where_clause
|
150
150
|
subselect_items << statement.delete_stmt.where_clause if statement.node == :delete_stmt && statement.delete_stmt.where_clause
|
151
151
|
|
152
|
+
if statement.node == :delete_stmt
|
153
|
+
statement.delete_stmt.using_clause.each do |using_clause|
|
154
|
+
from_clause_items << { item: using_clause, type: :select }
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
152
158
|
if value.with_clause
|
153
159
|
cte_statements, cte_names = statements_and_cte_names_for_with_clause(value.with_clause)
|
154
160
|
@cte_names.concat(cte_names)
|
@@ -237,7 +243,7 @@ module PgQuery
|
|
237
243
|
if next_item
|
238
244
|
case next_item.node
|
239
245
|
when :list
|
240
|
-
subselect_items += next_item.list.items
|
246
|
+
subselect_items += next_item.list.items.to_ary
|
241
247
|
when :a_expr
|
242
248
|
%w[lexpr rexpr].each do |side|
|
243
249
|
elem = next_item.a_expr.public_send(side)
|
@@ -264,6 +270,10 @@ module PgQuery
|
|
264
270
|
function: next_item.func_call.funcname.map { |f| f.string.str }.join('.'),
|
265
271
|
type: :call
|
266
272
|
}
|
273
|
+
when :case_expr
|
274
|
+
subselect_items.concat(next_item.case_expr.args.map { |arg| arg.case_when.expr })
|
275
|
+
subselect_items.concat(next_item.case_expr.args.map { |arg| arg.case_when.result })
|
276
|
+
subselect_items << next_item.case_expr.defresult
|
267
277
|
end
|
268
278
|
end
|
269
279
|
|
@@ -273,6 +283,7 @@ module PgQuery
|
|
273
283
|
when :join_expr
|
274
284
|
from_clause_items << { item: next_item[:item].join_expr.larg, type: next_item[:type] }
|
275
285
|
from_clause_items << { item: next_item[:item].join_expr.rarg, type: next_item[:type] }
|
286
|
+
subselect_items << next_item[:item].join_expr.quals
|
276
287
|
when :row_expr
|
277
288
|
from_clause_items += next_item[:item].row_expr.args.map { |a| { item: a, type: next_item[:type] } }
|
278
289
|
when :range_var
|
data/lib/pg_query/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_query
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Fittl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|