Skip to content

[pull] master from picodata:master #155

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

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
75e63d3
fix: tcp stream fd closed when there are still users of it
sqllqq Dec 10, 2024
7d9af50
test: add test for tcp clone working fine
sqllqq Dec 10, 2024
7ab0756
doc: unhide modules from documentation
gmoshkin Dec 10, 2024
588e3df
feat: add a generic parameter to error::Result<T, E=Error> (with defa…
gmoshkin Dec 10, 2024
ce0ce18
chore: new compilation warnings dropped
gmoshkin Dec 10, 2024
eecd7b2
feat: impl Default for TarantoolLogger
gmoshkin Dec 10, 2024
a2ce200
test: do waitpid for the ldap server after killing it
gmoshkin Dec 10, 2024
547e4bd
chore: new clippy warnings dropped
gmoshkin Dec 10, 2024
5d3b531
release: 6.1.0
gmoshkin Dec 10, 2024
5199d85
doc: update features section in README
e-ivkov Dec 11, 2024
46c577f
fix: header encoding silently truncate-casts iproto types
Nov 21, 2024
236b602
fix: support tarantool 2.11.5
e-ivkov Jan 10, 2025
4b66150
chore: fix changelog
gmoshkin Feb 7, 2025
f8c4572
fix!: declare all lua* ffi functions as C-unwind
gmoshkin Feb 10, 2025
721a88e
feat: update msrv from 1.71.1 to 1.81
Mar 7, 2025
d52b8d6
fix: use new stabilized methods to shut up clippy lints
Mar 7, 2025
e4c78b9
feat(picodata auth)!: md5 is now default auth method
Mar 3, 2025
02a6649
feat: add ExtType for msgpack encode/decode module
Apr 19, 2025
2ef689c
feat: add msgpack decode and encode for Decimal
Apr 19, 2025
8521b13
feat: add msgpack decode and encode for Datetime
Apr 19, 2025
4aa1182
feat: add msgpack decode and encode for UUID
Apr 19, 2025
32e7b7b
feat: add msgpack decode for tuples
Apr 28, 2025
0ec65f1
test: decoding ExtStruct inside structure
Apr 28, 2025
d28110e
docs: add changelog record
Apr 28, 2025
6d0eba9
test: unprepare the statements after each test
darthunix May 6, 2025
0d48bf1
test: fix wrong password error in tests
darthunix May 6, 2025
c72c0d3
feat: implement a C port wrapper
darthunix Apr 8, 2025
0e440fc
feat: introduce sql methods to store results into port
darthunix Apr 16, 2025
54d934b
feat: implement append and reset methods for obuf
darthunix Apr 23, 2025
1bb08fb
feat: implement methods to get first and last entries in port
darthunix Apr 24, 2025
cce3533
feat: test that changing port virtual table works
darthunix Apr 24, 2025
99b7730
fix: port and its virtual table bugs
darthunix Apr 30, 2025
09fabd3
fix: redundant mutability for tuple in port's add_tuple()
darthunix Apr 30, 2025
1930475
chore: fix comments and remove redundant code from port.
darthunix May 6, 2025
029f298
fix(tuple)!: unsupported tuple field public methods are panicking now
Apr 16, 2025
3633072
build(msrv)!: bump to 1.82
Apr 16, 2025
0c0ce4c
refactor: compiler and clippy small talks about warnings
Apr 16, 2025
a303f39
chore: add new entry template for changelog
Apr 16, 2025
94ac116
refactor(auth): split auth functions to implementation and encoding
May 7, 2025
00cd46f
fix!: `lua_dump` signature in port virtual table
darthunix May 21, 2025
bb4faab
release: 7.0.0
LizardWizzard May 26, 2025
801abc2
fix: fix usage of `tlua::LuaRead`, `tlua::LuaPush` and `tlua::LuaPush…
Jun 6, 2025
8ecd889
fix: fix a clippy lint that is not caught by tarantool-module CI, but…
Jun 11, 2025
e35a923
refactor: specify column identifier type as a generic parameter of `i…
May 12, 2025
5f2ca5b
chore: unpin tokio dependency from vulnerable version
LizardWizzard Jun 23, 2025
40bb5f0
chore: release 8.0.0 preparation
gmoshkin Jun 24, 2025
b52fa37
fix: unpin the version of `time` crate
Jul 2, 2025
466fd9b
fix: use space's bsize instead of its primary index's in `Space::bsiz…
Jul 8, 2025
c12982b
fix(audit): bump and replace unmaintained dependencies
Jul 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ variables:
KANIKO_REGISTRY_MIRROR: docker-proxy.binary.picodata.io
CACHE_PATHS: target
CARGO_INCREMENTAL: 0
RUST_VERSION: "1.71" # Note: without the quotes yaml thinks this is a float and removes the trailing 0
RUST_VERSION: "1.82" # Note: without the quotes yaml thinks this is a float and removes the trailing 0
CARGO_HOME: /shared-storage/tarantool-module/.cargo
BASE_IMAGE_VANILLA: docker-public.binary.picodata.io/tarantool-module-build-base-vanilla
BASE_IMAGE_FORK: docker-public.binary.picodata.io/tarantool-module-build-base-fork
Expand Down
144 changes: 140 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,146 @@
# Change Log
<!--
<TEMPLATE START>

# [?.?.?] Unreleased

### Added
- ?.

### Changed
- ?.

### Fixed
- ?.

### Deprecated
- ?.

### Breaking
- ?.

### Added (picodata)
- ?.

### Changed (picodata)
- ?.

### Fixed (picodata)
- ?.

### Deprecated (picodata)
- ?.

### Breaking (picodata)
- ?.

<TEMPLATE END>
-->

# Change Log

# [8.0.1] Unreleased

### Changed

- Unpinned the version of `linkme` crate (`0.3.29` -> `0.3`).

- Replaced dependency from unmaintained `dlopen` crate to `libloading` of version `0.3`.

- Replaced dependency from unmaintained `proc-macro-error` crate to `proc-macro-error2` of version `2`.

### Fixed
- Unpinned the version of `time` crate from a two-year old `0.3.17`
- `space::Space::bsize` now returns `box.space.<space_name>:bsize()` instead of `box.space.<space_name>.index[0]:bsize()`


# [8.0.0] Jun 24 2025

### Changed

- Unpinned the version of `tokio` crate optional dependency

### Fixed

- Fix `tlua::Push`, `tlua::PushInto` and `tlua::LuaRead` derive macros to support default values for type parameters,
and `tlua::LuaRead` to support default values for default values for const parameters.

### Deprecated

### Breaking

- Split a single `index::Part` type into `Part<String>`, `Part<u32>` and `Part<NumOrStr>`,
depending on the accepted/returned types by the tarantool API

# [7.0.0] May 26 2025

### Added

- `AuthMethod::DEFAULT` represents the default value of `AuthMethod`, but is available in constant contexts.
- Support MsgPack ExtType encoding and decoding via `ExtStruct`
- Support Tuple msgpack decoding
- Support Decimal, UUID, Datetime msgpack encoding and decoding

### Changed

- 1.82 is now MSRV.

### Fixed

- `network::protocol::codec::Header::encode` will not truncate to `u8` an
`network::protocol::codec::IProtoType` integer from an outside stream at decoding.

### Deprecated

### Breaking changes

- Use `extern "C-unwind"` instead of `extern "C"` for lua ffi functions, which
seems to help with lua_error!() in release builds on recent versions of rust.

### Added (picodata)

- `ffi::sql::PortC` either allows to append tuples and msgpacks to the port or
to iterate over the port data. It is also possible to manipulate with `PortC`
from the `FunctionCtx` of the called function.
- Introduce `sql::sql_execute_into_port` and `sql::Statement::execute_into_port`
methods. Now it is possible to store SQL results directly into the port.

### Changed (picodata)

### Fixed (picodata)

### Breaking changes (picodata)

- `AuthMethod::default()` is now `Md5`, not `ChapSha1`.
- `tarantool::tuple::Tuple::{as_named_buffer, names, name_count}` did not find their use, so they are now logging an
error message and panic. These functions are scheduled for removal in next major release and labeled as deprecated.

### Deprecated (picodata)

# [6.1.0] Dec 10 2024

### Added

- `network::client::tcp::TcpStream` not supports async connection, provided with `connect_async` and `connect_timeout_async` methods
- `impl Default for log::TarantoolLogger`

### Changed

- `error::Result` type alias now has another generic parameter E, which defaults
to `tarantool::error::Error`, but allows this type alias to be used as a drop
in replacement from `std::result::Result`.

### Fixed

- `network::client::tcp::TcpStream` does not close underlying fd anymore. Now fd will be closed only when the last copy of tcp stream is dropped.

### Deprecated

- `network::client::tcp::UnsafeSendSyncTcpStream` is now deprected. `network::client::tcp::TcpStream` should be used instead.

# [6.0.0] Nov 20 2024

### Added

- `tlua::Push` trait implementations for `OsString`, `OsStr`, `Path`, `PathBuf`
- `tlua::LuaRead` trait implementations for `OsString`, `PathBuf`
- tlua::LuaTable::metatable which is a better alternative to the existing `tlua::LuaTable::get_or_create_metatable`
Expand All @@ -26,33 +157,36 @@ restricting time connection establishment.
- `tlua::Nil` now supports (de)serialization via serde

### Changed

- `network::protocol::codec::IProtoType` uses C language representation
- `cbus::sync::std::ThreadWaker` now uses internal thread FIFO queue when blocking threads on send.
- `#[tarantool::proc]` attribute doesn't add procs to a global array unless
`stored_procs_slice` feature is enabled.
- `proc::all_procs` will now panic if `stored_procs_slice` feature is disabled.

### Fixed

- `tlua::{Push, PushInto, LuaRead}` now work for HashSet & HashMap with custom hashers.
- Use after free in `fiber::Builder::start_non_joinable` when the fiber exits without yielding.
- Incorrect, off-spec MP Ext type: caused runtime errors on some platforms.
- Panic in coio test starting from 1.80 Rust.
- Impossible to use procedural macros(like `tarantool::proc`, `tarantool::test`) through reexporting tarantool.

### Deprecated

- tlua::LuaTable::get_or_create_metatable is deprecated now in favor of tlua::LuaTable::metatable.

### Breaking changes

- Use `extern "C-unwind"` instead of `extern "C"` for all trampolines which take `*mut ffi::lua_State`
(checked with `rg 'extern "C".*lua_State'`). `tlua::error!` throws an exception to unwind the stack,
hence we need to use a proper ABI to fix UB in picodata.

### Breaking changes (picodata)

- Add session ID to the argument list of the `sql_prepare_ext`.
- Replace `sql_unprepare` with `sql_unprepare_ext` (contains an additional session ID argument).



# [5.0.0] Aug 06 2024

### Added
Expand Down Expand Up @@ -216,12 +350,14 @@ restricting time connection establishment.
**experimental** rust allocated implementation of tuple virtual table.

### Changed (picodata)

- `Tuple::decode` & `ToTupleBuffer` implementation for `Tuple` is now a bit more
efficient because one redundant tuple data copy is removed.

### Fixed (picodata)

### Breaking changes (picodata)

- SQL module was totally refactored: all its public structures functions and FFIs have
been changed.

Expand Down Expand Up @@ -294,7 +430,7 @@ restricting time connection establishment.

- `define_str_enum` will no longer produce warning "`&` without an explicit
lifetime name cannot be used here". For more information, see
https://github.com/rust-lang/rust/issues/115010.
<https://github.com/rust-lang/rust/issues/115010>.
- `#[tarantool::test]` declares a special static variable which is usually
invisible to the users, but previously it would have a not so unique name
which would sometimes lead to name conflicts with user-defined items.
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "1"
members = [
"tarantool",
"tarantool-proc",
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ rustflags = [
Add the following lines to your project's Cargo.toml:
```toml
[dependencies]
tarantool = "6.0"
tarantool = "7.0"

[lib]
crate-type = ["cdylib"]
Expand All @@ -66,8 +66,10 @@ See https://github.com/picodata/brod for example usage.

### Features

- `net_box` - Enables protocol implementation (enabled by default)
- `schema` - Enables schema manipulation utils (WIP as of now)
- `net_box` - Enables IPROTO fiber aware client (enabled by default)
- `network_client` - Enables a second implementation of IPROTO fiber aware client but with Rust async support (enabled by default)
- `picodata` - Enables support for custom features added in picodata's fork of tarantool
- `tokio_components` - Enables support for interfacing with tokio based logic through cbus

### Stored procedures

Expand Down Expand Up @@ -103,7 +105,7 @@ edition = "2018"
# author, license, etc

[dependencies]
tarantool = "6.0"
tarantool = "7.0"
serde = "1.0"

[lib]
Expand Down
3 changes: 0 additions & 3 deletions examples/async-h1-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use http_types::{Method, Request, Url};
use tarantool::error::Error;
use tarantool::fiber;
use tarantool::network::client::tcp::TcpStream;
use tarantool::network::client::tcp::UnsafeSendSyncTcpStream;
use tarantool::proc;

#[proc]
Expand All @@ -17,14 +16,12 @@ fn get(url: &str) -> Result<(), Error> {
let mut res = match url.scheme() {
"http" => {
let stream = TcpStream::connect(host, 80).map_err(Error::other)?;
let stream = UnsafeSendSyncTcpStream(stream);
println!("Sending request over http...");
async_h1::connect(stream, req).await.map_err(Error::other)?
}
#[cfg(feature = "tls")]
"https" => {
let stream = TcpStream::connect(host, 443).map_err(Error::other)?;
let stream = UnsafeSendSyncTcpStream(stream);
let stream = async_native_tls::connect(host, stream)
.await
.map_err(Error::other)?;
Expand Down
2 changes: 1 addition & 1 deletion examples/tokio-hyper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "BSD-2-Clause"
[dependencies]
tarantool = { path = "../../tarantool" }
hyper = { version = "0.14", features = ["full"] }
tokio = { version = "=1.29.1", features = ["full"] }
tokio = { version = "1", features = ["full"] }
futures-util = "*"
http-body-util = "0.1.0-rc.2"
env_logger = "0.9.0"
Expand Down
6 changes: 3 additions & 3 deletions tarantool-proc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ authors = [
]
name = "tarantool-proc"
description = "Tarantool proc macros"
version = "3.2.0"
version = "4.0.0"
edition = "2021"
license = "BSD-2-Clause"
documentation = "https://docs.rs/tarantool-proc/"
repository = "https://github.com/picodata/tarantool-module"
rust-version = "1.61"
rust-version = "1.82"

[lib]
proc-macro = true
Expand All @@ -19,7 +19,7 @@ syn = { version = "^1.0", features = [ "full", "extra-traits" ] }
quote = "^1.0"
proc-macro2 = "^1.0"
darling = "0.14.2"
proc-macro-error = "1"
proc-macro-error2 = "2"

[features]
stored_procs_slice = []
4 changes: 2 additions & 2 deletions tarantool-proc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use proc_macro::TokenStream;
use proc_macro2::{Span, TokenStream as TokenStream2};
use proc_macro_error::{proc_macro_error, SpanRange};
use proc_macro_error2::{proc_macro_error, SpanRange};
use quote::{quote, ToTokens};
use syn::{
parse_macro_input, parse_quote, punctuated::Punctuated, Attribute, AttributeArgs, DeriveInput,
Expand Down Expand Up @@ -34,7 +34,7 @@ pub fn test(attr: TokenStream, item: TokenStream) -> TokenStream {
mod msgpack {
use darling::FromDeriveInput;
use proc_macro2::TokenStream;
use proc_macro_error::{abort, SpanRange};
use proc_macro_error2::{abort, SpanRange};
use quote::{format_ident, quote, quote_spanned, ToTokens};
use syn::{
parse_quote, spanned::Spanned, Data, Field, Fields, FieldsNamed, FieldsUnnamed,
Expand Down
22 changes: 9 additions & 13 deletions tarantool/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tarantool"
description = "Tarantool rust bindings"
version = "6.0.0"
version = "8.0.1"
authors = [
"Dmitriy Koltsov <dkoltsov@picodata.io>",
"Georgy Moshkin <gmoshkin@picodata.io>",
Expand All @@ -15,18 +15,18 @@ documentation = "https://docs.rs/tarantool/"
repository = "https://github.com/picodata/tarantool-module"
keywords = ["ffi", "database", "tarantool"]
categories = ["database"]
rust-version = "1.71"
rust-version = "1.82"

[dependencies]
base64 = "0.13"
bitflags = "1.2"
dec = { version = "0.4.8", optional = true }
dlopen = "0.1.8"
libloading = "0.8"
thiserror = "1.0.30"
libc = { version = "0.2", features = ["extra_traits"] }
log = "0.4"
once_cell = "1.4.0"
tlua = { path = "../tlua", version = "4.0.0" }
tlua = { path = "../tlua", version = "6.0.1" }
refpool = { version = "0.4.3", optional = true }
rmp = "0.8.11"
rmp-serde = "1.1"
Expand All @@ -36,25 +36,21 @@ serde_json = "1.0"
serde_bytes = "^0"
sha-1 = "0.9"
md-5 = "0.10"
tarantool-proc = { path = "../tarantool-proc", version = "3.2.0" }
tarantool-proc = { path = "../tarantool-proc", version = "4.0.0" }
uuid = "0.8.2"
futures = "0.3.25"
linkme = "0.3.29"
linkme = "0.3"
async-trait = "0.1.64"
tester = { version = "0.7.0", optional = true }
time = ">=0.3.0, <0.3.18"
time = "0.3.37"
crossbeam-queue = { version = "0.3.8", optional = true }
async-std = { version = "1.12.0", optional = true, default-features = false, features = [
"std",
] }
pretty_assertions = { version = "1.4", optional = true }
tempfile = { version = "3.9", optional = true }
va_list = ">=0.1.4"
tokio = { version = "=1.29.1", features = [
"sync",
"rt",
"time",
], optional = true }
tokio = { version = "1", features = ["sync", "rt", "time"], optional = true }
anyhow = { version = "1", optional = true }

[features]
Expand All @@ -81,5 +77,5 @@ standalone_decimal = ["dec"]
stored_procs_slice = ["tarantool-proc/stored_procs_slice"]

[dev-dependencies]
time-macros = "=0.2.6"
time-macros = "0.2.6"
pretty_assertions = "1.4"
Loading