pg_query 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/ext/pg_query/extconf.rb +1 -1
- data/lib/pg_query/fingerprint.rb +10 -10
- data/lib/pg_query/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e699cba04d1b278f58c368193c6c43a2ebf17506
|
4
|
+
data.tar.gz: 8459ffee76d0577784347996c87ba3ecbe5fcc42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c264389fef9ebba3d4582e17e827aaabc320de78cfd07d020872af3b5a7e60cc681788cc20928f2386a045be0fed75788608fc922cbe75fbbb1c63fe5d16398
|
7
|
+
data.tar.gz: 580d6c662de265e1bfa55b08704c044ce45434e145b2b95985146ab4be6835c962bcb48b813d74eea8dc4e965b2ead91b29fe5e6e978f86acefd3245f30b00d8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.11.1 2016-06-26
|
4
|
+
|
5
|
+
* Updated fingerprinting logic to version 1.1
|
6
|
+
* Fixes an issue with UpdateStmt target lists being ignored
|
7
|
+
* Update to newest libpg_query version (9.5-1.4.0)
|
8
|
+
|
9
|
+
|
3
10
|
## 0.11.0 2016-06-22
|
4
11
|
|
5
12
|
* Improved table name analysis (#tables method)
|
data/ext/pg_query/extconf.rb
CHANGED
data/lib/pg_query/fingerprint.rb
CHANGED
@@ -33,26 +33,26 @@ class PgQuery
|
|
33
33
|
[nil, 0, false, [], ''].include?(val)
|
34
34
|
end
|
35
35
|
|
36
|
-
def fingerprint_value(val, hash,
|
36
|
+
def fingerprint_value(val, hash, parent_node_name, parent_field_name, need_to_write_name)
|
37
37
|
return if ignored_fingerprint_value?(val)
|
38
38
|
|
39
39
|
subhash = FingerprintSubHash.new
|
40
40
|
|
41
41
|
if val.is_a?(Hash)
|
42
|
-
fingerprint_node(val, subhash,
|
42
|
+
fingerprint_node(val, subhash, parent_node_name, parent_field_name)
|
43
43
|
elsif val.is_a?(Array)
|
44
|
-
fingerprint_list(val, subhash,
|
44
|
+
fingerprint_list(val, subhash, parent_node_name, parent_field_name)
|
45
45
|
else
|
46
46
|
subhash.update val.to_s
|
47
47
|
end
|
48
48
|
|
49
49
|
return if subhash.parts.empty?
|
50
50
|
|
51
|
-
hash.update(
|
51
|
+
hash.update(parent_field_name) if need_to_write_name
|
52
52
|
subhash.flush_to(hash)
|
53
53
|
end
|
54
54
|
|
55
|
-
def fingerprint_node(node, hash, parent_field_name = nil) # rubocop:disable Metrics/CyclomaticComplexity
|
55
|
+
def fingerprint_node(node, hash, parent_node_name = nil, parent_field_name = nil) # rubocop:disable Metrics/CyclomaticComplexity
|
56
56
|
node_name = node.keys.first
|
57
57
|
return if [A_CONST, ALIAS, PARAM_REF, SET_TO_DEFAULT, INT_LIST, OID_LIST, NULL].include?(node_name)
|
58
58
|
|
@@ -65,7 +65,7 @@ class PgQuery
|
|
65
65
|
when 'location'
|
66
66
|
next
|
67
67
|
when 'name'
|
68
|
-
next if node_name == RES_TARGET && parent_field_name == TARGET_LIST_FIELD
|
68
|
+
next if node_name == RES_TARGET && parent_node_name == SELECT_STMT && parent_field_name == TARGET_LIST_FIELD
|
69
69
|
next if [PREPARE_STMT, EXECUTE_STMT, DEALLOCATE_STMT].include?(node_name)
|
70
70
|
when 'gid'
|
71
71
|
next if node_name == TRANSACTION_STMT
|
@@ -73,15 +73,15 @@ class PgQuery
|
|
73
73
|
next if node_name == TRANSACTION_STMT
|
74
74
|
end
|
75
75
|
|
76
|
-
fingerprint_value(val, hash, field_name, true)
|
76
|
+
fingerprint_value(val, hash, node_name, field_name, true)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
def fingerprint_list(values, hash, parent_field_name)
|
80
|
+
def fingerprint_list(values, hash, parent_node_name, parent_field_name)
|
81
81
|
if [FROM_CLAUSE_FIELD, TARGET_LIST_FIELD, COLS_FIELD, REXPR_FIELD].include?(parent_field_name)
|
82
82
|
values_subhashes = values.map do |val|
|
83
83
|
subhash = FingerprintSubHash.new
|
84
|
-
fingerprint_value(val, subhash, parent_field_name, false)
|
84
|
+
fingerprint_value(val, subhash, parent_node_name, parent_field_name, false)
|
85
85
|
subhash
|
86
86
|
end
|
87
87
|
|
@@ -93,7 +93,7 @@ class PgQuery
|
|
93
93
|
end
|
94
94
|
else
|
95
95
|
values.each do |val|
|
96
|
-
fingerprint_value(val, hash, parent_field_name, false)
|
96
|
+
fingerprint_value(val, hash, parent_node_name, parent_field_name, false)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
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: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Fittl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|