[tarantool-patches] Re: [PATCH v1 2/3] sql: rework diag_set() in OP_Halt

Imeev Mergen imeevma at tarantool.org
Mon Apr 22 11:24:42 MSK 2019


On 4/15/19 6:21 PM, n.pettik wrote:
>
>> On 12 Apr 2019, at 15:34, imeevma at tarantool.org wrote:
>>
>> Before this patch it was possible to have an error code with wrong
>> error description. This patch fixes it.
> Could you please supply this statement with an example(s)?

Here it is:

tarantool> box.execute("CREATE TABLE t(a INT PRIMARY KEY, b INT);")
---
- row_count: 1
...

tarantool> box.execute("INSERT INTO t VALUES (1,2), (3,4);")
---
- row_count: 2
...

tarantool> box.execute("SELECT b FROM t WHERE a = (SELECT a FROM t);")
---
- error: 'SQL error: Expression subquery returned more than 1 row'
...

tarantool> box.error.last().code
---
- 159
...


 From the error message, we can say that this is an ER_SQL(160)
error. But this is wrong, as this is an ER_SQL_EXECUTE(159) error.





More information about the Tarantool-patches mailing list