pg_query 6.2.1 → 6.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6368eb8723a3304d1a1d3c60cd51e91903b6d755cd6b7a6a74a1c7b0ddee0d1f
4
- data.tar.gz: a5bc85ef1993dc502d600043c91901767facfafcaa0c0d811f4df6f401fac9d9
3
+ metadata.gz: e8fa448f7374b9cf04148d3c8d07903804122e7482b27d3a5f455ceb47ae9491
4
+ data.tar.gz: 936a383a21778c3a129bbbba8d85e8ad98cd969bc4c67bd3fffba9961dec82d2
5
5
  SHA512:
6
- metadata.gz: b5a7a69cd2224bed11134276a5f76d4e5cd2d3876e8b1613493e4e1ee67f9ec6409d5f2962f354a25352b678beaf98332b594067e8c80eeb16fb8fad25cf907a
7
- data.tar.gz: 9db3709022d52488e135f4092dbf3c35c33ec88f01573780eb407587749369fb201e25f55e6a9ac9c236a2c2cde0c8af57f30824eaf5a93cdcc784c4c874f646
6
+ metadata.gz: 156ebc20e60459230fdf485aac768634501f507e825b1021756feaa509936c13e4161de1118988fc4006f0127458ab490b4468d4e5eadd9dfeaf4e52c161d3ad
7
+ data.tar.gz: 1489fc1aa532728b5720f1514addccf33c46330851fa20515b980f31947f3e08beb5e54b3045a774aa6e50aef65c12f5b2870333a31160878a30ffabf6c22023
data/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  * ...
6
6
 
7
+ ## 6.2.2 2026-01-26
8
+
9
+ * Upgrade to libpg_query 17-6.2.2
10
+ - pg_query_normalize: Fix handling of special strings in DefElem
11
+ - This avoids a crash when running the normalize function on certain utility statements
12
+ - pg_query_deparse_comments_for_query: Add missing initialization
13
+ - This avoids a crash for callers that read the error field of the result when there is no error
14
+
15
+
7
16
  ## 6.2.1 2026-01-20
8
17
 
9
18
  * Upgrade to libpg_query 17-6.2.1
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ require 'rspec/core/rake_task'
5
5
  require 'rubocop/rake_task'
6
6
  require 'open-uri'
7
7
 
8
- LIB_PG_QUERY_TAG = '17-6.2.1'.freeze
9
- LIB_PG_QUERY_SHA256SUM = '678434d59511c8892c37ba5b9816ab641bd007cef2eda215b2297c39b79c861d'.freeze
8
+ LIB_PG_QUERY_TAG = '17-6.2.2'.freeze
9
+ LIB_PG_QUERY_SHA256SUM = 'e68962c18dbf5890821511be6c5c42261170bf8bfd51a82ea9176069f3d0df8b'.freeze
10
10
 
11
11
  Rake::ExtensionTask.new 'pg_query' do |ext|
12
12
  ext.lib_dir = 'lib/pg_query'
@@ -8,7 +8,7 @@ require 'pathname'
8
8
  $objs = Dir.glob(File.join(__dir__, '*.c')).map { |f| Pathname.new(f).sub_ext('.o').to_s }
9
9
 
10
10
  if RUBY_PLATFORM !~ /cygwin|mswin|mingw|bccwin|wince|emx/
11
- $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 -Wno-unknown-warning-option -g"
11
+ $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 -Wno-unknown-warning-option -Wno-shorten-64-to-32 -Wno-missing-noreturn -Wno-incompatible-pointer-types-discards-qualifiers -g"
12
12
  end
13
13
 
14
14
  $INCFLAGS = "-I#{File.join(__dir__, 'include')} " + "-I#{File.join(__dir__, 'include', 'postgres')} " + $INCFLAGS
@@ -88,7 +88,7 @@ pg_query_free_deparse_result(PgQueryDeparseResult result)
88
88
  PgQueryDeparseCommentsResult
89
89
  pg_query_deparse_comments_for_query(const char *query)
90
90
  {
91
- PgQueryDeparseCommentsResult result;
91
+ PgQueryDeparseCommentsResult result = {0};
92
92
  PgQueryScanResult scan_result_raw = pg_query_scan(query);
93
93
 
94
94
  if (scan_result_raw.error)
@@ -336,10 +336,20 @@ static void RecordConstLocation(pgssConstLocations *jstate, int location)
336
336
  }
337
337
  }
338
338
 
339
+ static bool is_string_delimiter(char c)
340
+ {
341
+ return c == '\'' || c == '$';
342
+ }
343
+
344
+ static bool is_special_string_start(char c)
345
+ {
346
+ return c == 'b' || c == 'B' || c == 'x' || c == 'X' || c == 'n' || c == 'N' || c == 'e' || c == 'E';
347
+ }
348
+
339
349
  static void record_defelem_arg_location(pgssConstLocations *jstate, int location)
340
350
  {
341
351
  for (int i = location; i < jstate->query_len; i++) {
342
- if (jstate->query[i] == '\'' || jstate->query[i] == '$') {
352
+ if (is_string_delimiter(jstate->query[i]) || (i + 1 < jstate->query_len && is_special_string_start(jstate->query[i]) && is_string_delimiter(jstate->query[i + 1]))) {
343
353
  RecordConstLocation(jstate, i);
344
354
  break;
345
355
  }
@@ -1,3 +1,3 @@
1
1
  module PgQuery
2
- VERSION = '6.2.1'.freeze
2
+ VERSION = '6.2.2'.freeze
3
3
  end
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: 6.2.1
4
+ version: 6.2.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: 2026-01-21 00:00:00.000000000 Z
11
+ date: 2026-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf