From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2C1592CE12 for ; Mon, 15 Oct 2018 15:04:53 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N1JfdQ8L7VYF for ; Mon, 15 Oct 2018 15:04:53 -0400 (EDT) Received: from smtp35.i.mail.ru (smtp35.i.mail.ru [94.100.177.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id E10912CCDB for ; Mon, 15 Oct 2018 15:04:52 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [tarantool-patches] Re: [PATCH] sql: make DROP TABLE delete entry from _sequence_data From: "n.pettik" In-Reply-To: Date: Mon, 15 Oct 2018 22:04:50 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <6ECC6ACC-2D22-4474-9445-873EAE757863@tarantool.org> References: <20181015183615.28548-1-korablev@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Vladislav Shpilevoy >> diff --git a/test/sql/drop-table.result b/test/sql/drop-table.result >> index 08f249668..bf02e3def 100644 >> --- a/test/sql/drop-table.result >> +++ b/test/sql/drop-table.result >> @@ -29,6 +29,23 @@ box.sql.execute("INSERT INTO zzzoobar VALUES (111, = 222, 'c3', 444)") >> --- >> - error: 'no such table: ZZZOOBAR' >> ... >> +-- gh-3712: if space features sequence, data from _sequence_data >> +-- must be deleted before space is dropped. >> +-- >> +box.sql.execute("CREATE TABLE t1 (id INT PRIMARY KEY = AUTOINCREMENT);") >> +--- >> +... >> +box.sql.execute("INSERT INTO t1 VALUES (NULL);") >> +--- >> +... >> +box.snapshot() >> +--- >> +- ok >> +... >> +test_run:cmd('restart server default') >=20 > Unfortunately, we have no luxury of time to restart a > server on such a simple test. Lets just check that > _sequence_data space is empty. But restart is a part of this test. Without recovery entry doesn=E2=80=99t= appear in _sequence_data. It is easy to check this out (on 2.0): tarantool> box.sql.execute("CREATE TABLE t1 (id INT PRIMARY KEY = AUTOINCREMENT);") --- ... tarantool> box.sql.execute("INSERT INTO t1 VALUES (NULL)") --- ... tarantool> box.snapshot() 2018-10-15 22:03:09.045 [29254] snapshot/101/main I> saving snapshot = `./00000000000000000006.snap.inprogress' 2018-10-15 22:03:09.045 [29254] snapshot/101/main I> done --- - ok ... tarantool> box.space._sequence_data:select() --- - [] =E2=80=A6 Then lets restart server and see at that space again: tarantool> os.exit() n:tarantool n.pettik$ ./src/tarantool=20 Tarantool 2.0.5-75-gdd8e14ffb type 'help' for interactive help tarantool> box.cfg{} 2018-10-15 22:03:58.932 [29259] main/101/interactive C> Tarantool = 2.0.5-75-gdd8e14ffb 2018-10-15 22:03:58.932 [29259] main/101/interactive C> log level 5 2018-10-15 22:03:58.933 [29259] main/101/interactive I> mapping = 268435456 bytes for memtx tuple arena... 2018-10-15 22:03:58.933 [29259] main/101/interactive I> mapping = 134217728 bytes for vinyl tuple arena... 2018-10-15 22:03:58.943 [29259] main/101/interactive I> recovery start 2018-10-15 22:03:58.943 [29259] main/101/interactive I> recovering from = `./00000000000000000006.snap' 2018-10-15 22:03:59.009 [29259] main/101/interactive I> recover from = `./00000000000000000006.xlog' 2018-10-15 22:03:59.009 [29259] main/101/interactive I> done = `./00000000000000000006.xlog' 2018-10-15 22:03:59.011 [29259] main/101/interactive I> ready to accept = requests 2018-10-15 22:03:59.011 [29259] main/107/checkpoint_daemon I> started 2018-10-15 22:03:59.012 [29259] main/107/checkpoint_daemon I> scheduled = the next snapshot at Tue Oct 16 00:02:23 2018 --- ... tarantool> box.space._sequence_data:select() --- - - [1, 1] ... So, to make this test be fair - restart is required.=