Skip to content

Commit 8b041ca

Browse files
committed
Fixes gh-2206 Behavior changes in SQL, third commit
1 parent 7106777 commit 8b041ca

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/reference/reference_sql/sql_statements_and_clauses.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ The detailed description of data types is in the section
289289
Column definition -- the rules for the SCALAR data type
290290
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
291291

292-
The rules for the SCALAR data type were significantly changed in Tarantool version 2.10.1.
292+
The rules for the SCALAR data type were significantly changed in Tarantool version :tarantool-release:`2.10.0-beta1`.
293293

294294
SCALAR is a "complex" data type, unlike all the other data types which are "primitive".
295295
Two column values in a SCALAR column can have two different primitive data types.
@@ -348,14 +348,14 @@ Two column values in a SCALAR column can have two different primitive data types
348348
The comparison is valid, because Tarantool knows the ordering of X'41' and 'a'
349349
in Tarantool/NoSQL 'scalar' -- this is a case where the primitive type matters.
350350
#. The result data type of :ref:`min/max <sql_aggregate>` operation on a column defined as SCALAR
351-
is the data type of the minimum/maximum operand, unless the result value
352-
is NULL. For example:
351+
is SCALAR.
352+
Users will need to know the underlying primitive type of the result in advance. For example:
353353

354354
.. code-block:: sql
355355
356356
CREATE TABLE t (s1 INTEGER, s2 SCALAR PRIMARY KEY);
357357
INSERT INTO t VALUES (1, X'44'), (2, 11), (3, 1E4), (4, 'a');
358-
SELECT min(s2), hex(max(s2)) FROM t;
358+
SELECT cast(min(s2) AS INTEGER), hex(cast(max(s2) as VARBINARY)) FROM t;
359359
360360
The result is: ``- - [11, '44',]``
361361

@@ -3265,7 +3265,7 @@ Syntax:
32653265

32663266
Return the hexadecimal code for each byte in **expression**.
32673267

3268-
Starting with Tarantool version 2.10.1, the expression must be a byte sequence
3268+
Starting with Tarantool version 2.10.0, the expression must be a byte sequence
32693269
(data type VARBINARY).
32703270

32713271
In earlier versions of Tarantool, the expression could be either a string or a byte sequence.

doc/reference/reference_sql/sql_user_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ A literal has :ref:`data type = VARBINARY <sql_data_type_varbinary>`
214214

215215
Here are four ways to put non-ASCII characters,such as the Greek letter α alpha, in string literals: |br|
216216
First make sure that your shell program is set to accept characters as UTF-8. A simple way to check is |br|
217-
``SELECT hex('α');``
217+
``SELECT hex(cast('α' as VARBINARY));``
218218
If the result is CEB1 -- which is the hexadecimal value for the UTF-8 representation of α -- it is good. |br|
219219
(1) Simply enclose the character inside ``'...'``, |br|
220220
``'α'`` |br|

0 commit comments

Comments
 (0)