Commits
- Commit:
46df0daedf04b4371ba1c9508ebfb9fb9fb77ccb
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Date:
sql: forbid non-integer values in datetime
The patch forbids using non-integer values in datetime's `:set()`
for `year`, `month`, `day`, `hour`, `min`, `sec`, `usec`, `msec`,
`nsec` and `tzoffset` keys. `timestamp` can be double, and integer
values allowed in timestamp if `nsec`, `usec`, or `msecs`
provided. An error will be raised when a value of incorrect type
is passed.
Fixes #10391
@TarantoolBot document
Title: Update types of datetime values passed to SQL's `CAST();`
`CAST` can accept only integer values for `year`, `month`, `day`,
`hour`, `min`, `sec`, `usec`, `msec`, `nsec` and `tzoffset`.
`timestamp` can be integer or double.
(cherry picked from commit f57be571b5e4cc8d57c7e97c15b52df37ad6f12c)
- Commit:
13cdf4067eb49002971ffbf91ed6e3d64216f450
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Date:
datetime: forbid non-integers in :set() and parse()
The patch forbids using non-integer values in datetime's `:set()`
for `year`, `month`, `day`, `hour`, `min`, `sec`, `usec`, `msec`
and `nsec` keys. The type of `tzoffset` can be integer or string,
`timestamp` can be double, and integer values allowed in timestamp
if `nsec`, `usec`, or `msecs` provided. An error will be raised
when a value of incorrect type is passed.
Part of #10391
@TarantoolBot document
Title: Update types of values passed to `:set()` and parse()
`:set()` can accept only integer values for `year`, `month`,
`day`, `hour`, `min`, `sec`, `usec`, `msec` and `nsec`.
The type of `tzoffset` can be integer or string, `timestamp` can
be integer or double. `tzoffset` passed to `datetime.parse()`
can be integer or string.
(cherry picked from commit 6e77907baa3cbeebc79241cc0046a539a09e3f2c)
- Commit:
7b1e49e79b9be681166026d6bea76a6fa17cd550
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Date:
datetime: forbid using non-integer values in .new()
The patch forbids using non-integer values in datetime constructor
`datetime.new()` for `year`, `month`, `day`, `hour`, `min`, `sec`,
`usec`, `msec` and `nsec` keys. The type of `tzoffset` can be
integer or string, `timestamp` can be double, and integer values
allowed in timestamp if `nsec`, `usec`, or `msecs` provided.
An error will be raised when a value of incorrect type is passed.
Part of #10391
@TarantoolBot document
Title: Update types of values passed to `datetime.new()`
`datetime.new()` can accept only integer values for `year`,
`month`, `day`, `hour`, `min`, `sec`, `usec`, `msec` and `nsec`.
The type of `tzoffset` can be integer or string, `timestamp` can
be integer or double.
(cherry picked from commit cc9010a2b11477b2f16f2b2e168a6b9dcca2fb20)
- Commit:
18ebf41d38a84d1a4da5c34ed097fb3e9e7b443f
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Via:
- Sergey Kaplun <sergey_v_kaplun@mail.ru>
- Date:
cmake: propagate UBsan option to LuaJIT build
The commit bf01fb200777 ("luajit: bump new version") introduced
the LUAJIT_USE_UBSAN option in LuaJIT. The patch propagates the
CMake option ENABLE_UB_SANITIZER used in Tarantool to the LuaJIT
build.
Needed for #10145
NO_CHANGELOG=build
NO_DOC=build
NO_TEST=build
(cherry picked from commit b58791cf532c5a76a6941221358ca007bc97a85b)
- Commit:
7348a3998ad2435a907529cc66d605a9e890ea31
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Via:
- Sergey Kaplun <sergey_v_kaplun@mail.ru>
- Date:
varbinary: fix UB in a varbinary.new()
With enabled UndefinedBehavior Sanitizer runtime error like
below is triggered:
NO_WRAP
$ UBSAN_OPTIONS=external_symbolizer_path=/usr/lib/llvm-13/bin/llvm-symbolizer:print_stacktrace=1
$ ./build/src/tarantool -e "require('varbinary').new()"
/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lib_ffi.c:710:14: \
runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here
NO_WRAP
This happened because in the varbinary constructor, the NULL
pointer was passed to `ffi.copy()` and then to `memcpy()`, which
is an undefined behaviour.
The patch fixes that.
Needed for #10145
NO_CHANGELOG=codehealth
NO_DOC=codehealth
NO_TEST=codehealth
(cherry picked from commit 30179d44da65f835d81494ad63e86935f1c5aad0)