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 F1DB22A9ED for ; Tue, 18 Sep 2018 22:23:41 -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 YtSSx9PIdllp for ; Tue, 18 Sep 2018 22:23:41 -0400 (EDT) Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [94.100.177.96]) (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 AD8DD2A9EA for ; Tue, 18 Sep 2018 22:23:38 -0400 (EDT) Date: Wed, 19 Sep 2018 05:23:35 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/6] sql: pass true types of columns to Tarantool Message-ID: <20180919022335.GB2386@chai> References: <9a94105515bd4f9148f302b24230d0918cfccdf9.1537216078.git.korablev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a94105515bd4f9148f302b24230d0918cfccdf9.1537216078.git.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: Georgy Kirichenko * Nikita Pettik [18/09/18 01:20]: > From: Georgy Kirichenko > > As a main part of introducing strict typing in SQL it is required to > prohibit typeless columns in parser's grammar. Originally, SQLite simply > assigns typeless columns to BLOB affinity. Moreover, due to historical > reasons, all columns were stored with type in Tarantool core > (except for when it comes to primary key). Column type should > be defined on table creation. Allowed data types are: , , > , , , , , , , > and . However, still any declared data type is > converted to one of , , or affinities. > While affinity reaches space format, it is (again) converted to > Tarantool's field type. To be more precise, table of conversions: > > +----------+----------+------------+ > | SQL TYPE | AFFINITY | FIELD TYPE | > +----------+----------+------------+ > | FLOAT | REAL | NUMBER | > | REAL | REAL | NUMBER | > | DOUBLE | REAL | NUMBER | > | NUMERIC | REAL | NUMBER | > | DECIMAL | REAL | NUMBER | > | INTEGER | INTEGER | INTEGER | > | TEXT | TEXT | STRING | > | VARCHAR | TEXT | STRING | > | CHAR | TEXT | STRING | > | BLOB | BLOB | SCALAR | > | DATETIME | REAL | NUMBER | > | DATE | REAL | NUMBER | > | TIME | REAL | NUMBER | > +----------+----------+------------+ How do you manage to store datetime/date/time values as numbers? What is your conversion procedure? Are you storing it as unix timestamp? Note that SQL date begins (AFAIR) at 1900-01-01. > -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov