Skip to content

Commit

Permalink
Bump libpg_query version to 15-4.2.0 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
msepga authored Feb 13, 2023
1 parent 5eaaa66 commit 0a89307
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Unreleased

* Upgrade to PostgreSQL 15.1 via libpg_query 4.0.0
* Upgrade to PostgreSQL 15.1 via libpg_query 4.2.0
* Improve `ParseResult::tables()` to find tables in `cast` expressions

## 0.7.0 2022-07-19
Expand Down
4 changes: 2 additions & 2 deletions src/query.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::ffi::{CStr, CString};
use std::os::raw::{c_char, c_uint};
use std::os::raw::c_char;

use prost::Message;

Expand Down Expand Up @@ -67,7 +67,7 @@ pub fn parse(statement: &str) -> Result<ParseResult> {
/// Note that this function will panic if called on a node not defined in `deparseStmt`
pub fn deparse(protobuf: &protobuf::ParseResult) -> Result<String> {
let buffer = protobuf.encode_to_vec();
let len = buffer.len() as c_uint;
let len = buffer.len() as size_t;
let input = unsafe { CStr::from_bytes_with_nul_unchecked(&buffer) };
let data = input.as_ptr() as *mut c_char;
let protobuf = PgQueryProtobuf { data: data, len: len };
Expand Down

0 comments on commit 0a89307

Please sign in to comment.