Description
Tarantool version:
Tarantool 2.6.0-115-ge19b392f05
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=ON
Compiler: /usr/bin/cc /usr/bin/c++
C_FLAGS: -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -fopenmp -msse2 -std=c11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-format-truncation -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type -Werror
CXX_FLAGS: -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -fopenmp -msse2 -std=c++11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-format-truncation -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -Werror
OS version:
- Linux (Debian 9)
- OSX 14
Bug description:
results file checksum: 417a95fc995bbfbf7115bbde5c42028e
[013] --- sql/prepared.result Sat Sep 26 20:53:36 2020
[013] +++ sql/prepared.reject Sun Sep 27 23:39:11 2020
[013] @@ -409,6 +409,8 @@
[013] assert(res ~= nil)
[013] end;
[013] | ---
[013] + | - error: '[string "if not is_remote then res = s:execute() ..."]:1: assertion
[013] + | failed!'
[013] | ...
[013] test_run:cmd("setopt delimiter ''");
[013] | ---
[013] @@ -416,7 +418,7 @@
[013] | ...
[013] unprepare(s.stmt_id)
[013] | ---
[013] - | - null
[013] + | - error: Prepared statement with id 119053220 does not exist
[013] | ...
[013]
[013] s = prepare("SELECT count(*), count(a - 3), max(b), abs(id) FROM test WHERE b = '3';")
[013] @@ -692,28 +694,40 @@
[013] --
[013] box.cfg{sql_cache_size = 0 }
[013] | ---
[013] + | - error: 'Failed to prepare SQL statement: Can''t reduce memory limit for SQL prepared
[013] + | statements: please, deallocate active statements'
[013] | ...
[013] assert(box.info.sql().cache.stmt_count == 0)
[013] | ---
[013] - | - true
[013] + | - error: assertion failed!
[013] | ...
[013] assert(box.info.sql().cache.size == 0)
[013] | ---
[013] - | - true
[013] + | - error: assertion failed!
[013] | ...
[013] prepare("SELECT a FROM test;")
[013] | ---
[013] - | - error: 'Failed to prepare SQL statement: Memory limit for SQL prepared statements
[013] - | has been reached. Please, deallocate active statements or increase SQL cache size.'
[013] + | - stmt_id: 482388757
[013] + | execute: 'function: 0x40a20410'
[013] + | params: []
[013] + | unprepare: 'function: 0x40a20438'
[013] + | metadata:
[013] + | - name: A
[013] + | type: number
[013] + | param_count: 0
[013] | ...
[013] box.cfg{sql_cache_size = 0}
[013] | ---
[013] + | - error: 'Failed to prepare SQL statement: Can''t reduce memory limit for SQL prepared
[013] + | statements: please, deallocate active statements'
[013] | ...
[013]
[013] -- Still with small size everything should work.
[013] --
[013] box.cfg{sql_cache_size = 1500}
[013] | ---
[013] + | - error: 'Failed to prepare SQL statement: Can''t reduce memory limit for SQL prepared
[013] + | statements: please, deallocate active statements'
[013] | ...
[013]
[013] test_run:cmd("setopt delimiter ';'");
[013] @@ -735,12 +749,22 @@
[013] | ...
[013] assert(ok == false);
[013] | ---
[013] - | - true
[013] + | - error: assertion failed!
[013] | ...
[013] res;
[013] | ---
[013] - | - 'Failed to prepare SQL statement: Memory limit for SQL prepared statements has been
[013] - | reached. Please, deallocate active statements or increase SQL cache size.'
[013] + | - stmt_id: 3383028125
[013] + | execute: 'function: 0x40a262c8'
[013] + | params: []
[013] + | unprepare: 'function: 0x40a262f0'
[013] + | metadata:
[013] + | - name: ID
[013] + | type: integer
[013] + | - name: A
[013] + | type: number
[013] + | - name: B
[013] + | type: string
[013] + | param_count: 0
[013] | ...
[013]
[013] -- Check that after fiber is dead, its session gets rid of
[013] @@ -754,6 +778,8 @@
[013] | ...
[013] box.cfg{sql_cache_size = 0};
[013] | ---
[013] + | - error: 'Failed to prepare SQL statement: Can''t reduce memory limit for SQL prepared
[013] + | statements: please, deallocate active statements'
[013] | ...
[013] box.cfg{sql_cache_size = 3000};
[013] | ---
[013]
results file checksum: 16472636b3dcd186007b89f76912fa12
[005] --- sql/prepared.result Mon Sep 28 11:15:43 2020
[005] +++ sql/prepared.reject Mon Sep 28 12:08:43 2020
[005] @@ -179,6 +179,8 @@
[005] assert(res ~= nil)
[005] end;
[005] | ---
[005] + | - error: '[string "if not is_remote then res = s:execute({1,..."]:1: assertion
[005] + | failed!'
[005] | ...
[005] test_run:cmd("setopt delimiter ''");
[005] | ---
[005] @@ -186,16 +188,16 @@
[005] | ...
[005] unprepare(s.stmt_id)
[005] | ---
[005] - | - null
[005] + | - error: Prepared statement with id 3603193623 does not exist
[005] | ...
[005]
[005] assert(box.info.sql().cache.stmt_count == 0)
[005] | ---
[005] - | - true
[005] + | - error: assertion failed!
[005] | ...
[005] assert(box.info.sql().cache.size == 0)
[005] | ---
[005] - | - true
[005] + | - error: assertion failed!
[005] | ...
[005]
[005] -- Test preparation of different types of queries.
[005] @@ -692,28 +694,40 @@
[005] --
[005] box.cfg{sql_cache_size = 0 }
[005] | ---
[005] + | - error: 'Failed to prepare SQL statement: Can''t reduce memory limit for SQL prepared
[005] + | statements: please, deallocate active statements'
[005] | ...
[005] assert(box.info.sql().cache.stmt_count == 0)
[005] | ---
[005] - | - true
[005] + | - error: assertion failed!
[005] | ...
[005] assert(box.info.sql().cache.size == 0)
[005] | ---
[005] - | - true
[005] + | - error: assertion failed!
[005] | ...
[005] prepare("SELECT a FROM test;")
[005] | ---
[005] - | - error: 'Failed to prepare SQL statement: Memory limit for SQL prepared statements
[005] - | has been reached. Please, deallocate active statements or increase SQL cache size.'
[005] + | - stmt_id: 482388757
[005] + | execute: 'function: 0x010d34b010'
[005] + | params: []
[005] + | unprepare: 'function: 0x010d34b048'
[005] + | metadata:
[005] + | - name: A
[005] + | type: number
[005] + | param_count: 0
[005] | ...
[005] box.cfg{sql_cache_size = 0}
[005] | ---
[005] + | - error: 'Failed to prepare SQL statement: Can''t reduce memory limit for SQL prepared
[005] + | statements: please, deallocate active statements'
[005] | ...
[005]
[005] -- Still with small size everything should work.
[005] --
[005] box.cfg{sql_cache_size = 1500}
[005] | ---
[005] + | - error: 'Failed to prepare SQL statement: Can''t reduce memory limit for SQL prepared
[005] + | statements: please, deallocate active statements'
[005] | ...
[005]
[005] test_run:cmd("setopt delimiter ';'");
[005] @@ -735,12 +749,22 @@
[005] | ...
[005] assert(ok == false);
[005] | ---
[005] - | - true
[005] + | - error: assertion failed!
[005] | ...
[005] res;
[005] | ---
[005] - | - 'Failed to prepare SQL statement: Memory limit for SQL prepared statements has been
[005] - | reached. Please, deallocate active statements or increase SQL cache size.'
[005] + | - stmt_id: 3383028125
[005] + | execute: 'function: 0x010d34cca8'
[005] + | params: []
[005] + | unprepare: 'function: 0x010d34cce0'
[005] + | metadata:
[005] + | - name: ID
[005] + | type: integer
[005] + | - name: A
[005] + | type: number
[005] + | - name: B
[005] + | type: string
[005] + | param_count: 0
[005] | ...
[005]
[005] -- Check that after fiber is dead, its session gets rid of
[005] @@ -754,6 +778,8 @@
[005] | ...
[005] box.cfg{sql_cache_size = 0};
[005] | ---
[005] + | - error: 'Failed to prepare SQL statement: Can''t reduce memory limit for SQL prepared
[005] + | statements: please, deallocate active statements'
[005] | ...
[005] box.cfg{sql_cache_size = 3000};
[005] | ---
[005] @@ -771,6 +797,8 @@
[005]
[005] s = prepare("SELECT id, SLEEP() FROM test;");
[005] | ---
[005] + | - error: 'Failed to prepare SQL statement: Memory limit for SQL prepared statements
[005] + | has been reached. Please, deallocate active statements or increase SQL cache size.'
[005] | ...
[005] assert(s ~= nil);
[005] | ---
[005] @@ -794,12 +822,14 @@
[005] | ...
[005] f2:join();
[005] | ---
[005] - | - true
[005] + | - false
[005] + | - 'Failed to prepare SQL statement: Memory limit for SQL prepared statements has been
[005] + | reached. Please, deallocate active statements or increase SQL cache size.'
[005] | ...
[005]
[005] unprepare(s.stmt_id);
[005] | ---
[005] - | - null
[005] + | - error: Prepared statement with id 1495950315 does not exist
[005] | ...
[005]
[005] -- Now during execution of one prepared statement, in another
[005] @@ -825,7 +855,9 @@
[005] | ...
[005] f2:join();
[005] | ---
[005] - | - true
[005] + | - false
[005] + | - 'Failed to prepare SQL statement: Memory limit for SQL prepared statements has been
[005] + | reached. Please, deallocate active statements or increase SQL cache size.'
[005] | ...
[005]
[005] -- tarantool/tarantool#4825: make sure that values to be bound are erased after
[005] @@ -834,46 +866,24 @@
[005] --
[005] s = prepare('SELECT :a, :b, :c');
[005] | ---
[005] + | - error: 'Failed to prepare SQL statement: Memory limit for SQL prepared statements
[005] + | has been reached. Please, deallocate active statements or increase SQL cache size.'
[005] | ...
[005] execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
[005] | ---
[005] - | - metadata:
[005] - | - name: COLUMN_1
[005] - | type: integer
[005] - | - name: COLUMN_2
[005] - | type: integer
[005] - | - name: COLUMN_3
[005] - | type: integer
[005] - | rows:
[005] - | - [1, 2, 3]
[005] + | - error: Prepared statement with id 1495950315 does not exist
[005] | ...
[005] execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
[005] | ---
[005] - | - metadata:
[005] - | - name: COLUMN_1
[005] - | type: integer
[005] - | - name: COLUMN_2
[005] - | type: integer
[005] - | - name: COLUMN_3
[005] - | type: boolean
[005] - | rows:
[005] - | - [1, 2, null]
[005] + | - error: Prepared statement with id 1495950315 does not exist
[005] | ...
[005] execute(s.stmt_id);
[005] | ---
[005] - | - metadata:
[005] - | - name: COLUMN_1
[005] - | type: boolean
[005] - | - name: COLUMN_2
[005] - | type: boolean
[005] - | - name: COLUMN_3
[005] - | type: boolean
[005] - | rows:
[005] - | - [null, null, null]
[005] + | - error: Prepared statement with id 1495950315 does not exist
[005] | ...
[005] unprepare(s.stmt_id);
[005] | ---
[005] - | - null
[005] + | - error: Prepared statement with id 1495950315 does not exist
[005] | ...
[005]
[005] if is_remote then
[005]
Steps to reproduce:
Optional (but very desirable):
- coredump
- backtrace
- netstat