[tarantool-patches] Re: [PATCH 3/6] sql: pass true types of columns to Tarantool

n.pettik korablev at tarantool.org
Fri Oct 12 14:18:58 MSK 2018


>> diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c
>> index b57e3811d..cde6bf996 100644
>> --- a/src/box/sql/expr.c
>> +++ b/src/box/sql/expr.c
>> @@ -99,6 +99,22 @@ sqlite3ExprAffinity(Expr * pExpr)
>>  		return sqlite3ExprAffinity(pExpr->pLeft->x.pSelect->pEList->
>>  					   a[pExpr->iColumn].pExpr);
>>  	}
>> +	if (op == TK_PLUS) {
>> +		assert(pExpr->pRight != NULL && pExpr->pLeft != NULL);
>> +		enum affinity_type lhs_aff = sqlite3ExprAffinity(pExpr->pLeft);
>> +		enum affinity_type rhs_aff = sqlite3ExprAffinity(pExpr->pRight);
>> +		return sql_affinity_result(rhs_aff, lhs_aff);
>> +	}
>> +	if (op == TK_COLUMN) {
>> +		assert(pExpr->space_def != NULL);
>> +		const char *col_name = pExpr->u.zToken;
>> +		size_t name_len = strlen(col_name);
>> +		uint32_t field_no;
>> +		tuple_fieldno_by_name(pExpr->space_def->dict, col_name, name_len,
>> +				      field_name_hash(col_name, name_len),
>> +				      &field_no);
> 
> 1. Why are you sure that tuple_fieldno_by_name can not
> return an error?
> 2. This code is unreachable - in the same function on line 93 TK_COLUMN
> is processed already.

Nevermind, this branch really turns out to be unreachable.
AFAIR my initial intend was to handle column aliases for VIEW,
but they seem to work without handling this case.

> What is curious - I removed this hunk entirely and next commit's tests
> passed. So op == TK_PLUS check here is not needed as well, is it? I guess,
> it is already processed in another place.

It was attempt at storing right type for view’s columns when it comes for expressions.
Fore example:

CREATE TABLE t1 (id INT PRIMARY KEY, a FLOAT);
CREATE VIEW v1 AS SELECT id + a, id - a FROM t1;
SELECT * FROM “_space”;
…

  - [513, 1, 'V1', 'memtx', 2, {'sql': 'CREATE VIEW v1 AS SELECT id + a, id - a FROM
        t1', 'view': true}, [{'affinity': 67, 'type': 'number', 'nullable_action': 'none',
        'name': 'id + a', 'is_nullable': true}, {'affinity': 65, 'type': 'scalar',
        'nullable_action': 'none', 'name': 'id - a', 'is_nullable': true}]]
…

One can see that affinity and type for “id + a” are calculated correctly,
but for “id - a” - wrong. But I forgot to extend for other binary operators,
so lets do it right now. Moreover, I noticed that  columnType() function
returns wrong type result for expressions. Actually, we don’t need it anymore:
we can calculate resulting affinity using sqlite3ExprAffinity() and convert affinity
to native type. And result will be more accurate. Hence, I removed columnType()
(it was used only one place) and instead now we calculate and convert affinity.
See diff below:

diff --git a/src/box/sql/build.c b/src/box/sql/build.c
index 163d02fd4..d8a607126 100644
--- a/src/box/sql/build.c
+++ b/src/box/sql/build.c
@@ -529,10 +529,6 @@ sql_field_retrieve(Parse *parser, Table *table, uint32_t id)
-/**
- * Helper to convert SQLite affinity to corresponding
- * Tarantool field type.
- **/
-static enum field_type
+enum field_type
 sql_affinity_to_field_type(enum affinity_type affinity)
 {
        switch (affinity) {
diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c
index cde6bf996..47e5563d0 100644
--- a/src/box/sql/expr.c
+++ b/src/box/sql/expr.c
@@ -72,48 +72,50 @@ sqlite3TableColumnAffinity(struct space_def *def, int idx)
 char
 sqlite3ExprAffinity(Expr * pExpr)
 {
-       int op;
        pExpr = sqlite3ExprSkipCollate(pExpr);
        if (pExpr->flags & EP_Generic)
                return 0;
-       op = pExpr->op;
-       if (op == TK_SELECT) {
-               assert(pExpr->flags & EP_xIsSelect);
-               return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].
-                                          pExpr);
-       }
+       uint8_t op = pExpr->op;
        if (op == TK_REGISTER)
                op = pExpr->op2;
-#ifndef SQLITE_OMIT_CAST
-       if (op == TK_CAST) {
+       switch (op) {
+       case TK_SELECT:
+               assert(pExpr->flags & EP_xIsSelect);
+               return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr);
+       case TK_CAST:
                assert(!ExprHasProperty(pExpr, EP_IntValue));
                return pExpr->affinity;
-       }
-#endif
-       if (op == TK_AGG_COLUMN || op == TK_COLUMN) {
+       case TK_AGG_COLUMN:
+       case TK_COLUMN:
+               assert(pExpr->iColumn >= 0);
                return sqlite3TableColumnAffinity(pExpr->space_def,
                                                  pExpr->iColumn);
-       }
-       if (op == TK_SELECT_COLUMN) {
+       case TK_SELECT_COLUMN:
                assert(pExpr->pLeft->flags & EP_xIsSelect);
                return sqlite3ExprAffinity(pExpr->pLeft->x.pSelect->pEList->
-                                          a[pExpr->iColumn].pExpr);
-       }
-       if (op == TK_PLUS) {
+                       a[pExpr->iColumn].pExpr);
+       case TK_PLUS:
+       case TK_MINUS:
+       case TK_STAR:
+       case TK_SLASH:
                assert(pExpr->pRight != NULL && pExpr->pLeft != NULL);
                enum affinity_type lhs_aff = sqlite3ExprAffinity(pExpr->pLeft);
                enum affinity_type rhs_aff = sqlite3ExprAffinity(pExpr->pRight);
                return sql_affinity_result(rhs_aff, lhs_aff);
-       }
-       if (op == TK_COLUMN) {
-               assert(pExpr->space_def != NULL);
-               const char *col_name = pExpr->u.zToken;
-               size_t name_len = strlen(col_name);
-               uint32_t field_no;
-               tuple_fieldno_by_name(pExpr->space_def->dict, col_name, name_len,
-                                     field_name_hash(col_name, name_len),
-                                     &field_no);
-               return pExpr->space_def->fields[field_no].affinity;
+       case TK_LT:
+       case TK_GT:
+       case TK_EQ:
+       case TK_LE:
+       case TK_NE:
+       case TK_NOT:
+       case TK_AND:
+       case TK_OR:
+               /*
+                * FIXME: should be changed to BOOL type or
+                * affinity when it is implemented. Now simply
+                * return INTEGER.
+                */
+               return AFFINITY_INTEGER;
        }
        return pExpr->affinity;
 }
diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 849c0f871..cc49e27cb 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1582,138 +1582,7 @@ generateSortTail(Parse * pParse,        /* Parsing context */
  * This routine has either 3 or 6 parameters depending on whether or not
  * the SQLITE_ENABLE_COLUMN_METADATA compile-time option is used.
  */
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-#define columnType(A,B,C,D) columnTypeImpl(A,B,C,D)
-#else                          /* if !defined(SQLITE_ENABLE_COLUMN_METADATA) */
-#define columnType(A,B,C,D) columnTypeImpl(A,B)
-#endif
-static enum field_type
-columnTypeImpl(NameContext * pNC, Expr * pExpr
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-              , const char **pzOrigCol,
-#endif
-)
-{
-       enum field_type column_type = FIELD_TYPE_SCALAR;
-       int j;
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-       char const *zOrigTab = 0;
-       char const *zOrigCol = 0;
-#endif
-
-       assert(pExpr != 0);
-       assert(pNC->pSrcList != 0);
-       switch (pExpr->op) {
-       case TK_AGG_COLUMN:
-       case TK_COLUMN:{
-                       /* The expression is a column. Locate the table the column is being
-                        * extracted from in NameContext.pSrcList. This table may be real
-                        * database table or a subquery.
-                        */
-                       Table *pTab = 0;        /* Table structure column is extracted from */
-                       Select *pS = 0; /* Select the column is extracted from */
-                       int iCol = pExpr->iColumn;      /* Index of column in pTab */
-                       testcase(pExpr->op == TK_AGG_COLUMN);
-                       testcase(pExpr->op == TK_COLUMN);
-                       while (pNC && !pTab) {
-                               SrcList *pTabList = pNC->pSrcList;
-                               for (j = 0;
-                                    j < pTabList->nSrc
-                                    && pTabList->a[j].iCursor != pExpr->iTable;
-                                    j++) ;
-                               if (j < pTabList->nSrc) {
-                                       pTab = pTabList->a[j].pTab;
-                                       pS = pTabList->a[j].pSelect;
-                               } else {
-                                       pNC = pNC->pNext;
-                               }
-                       }
-
-                       if (pTab == 0) {
-                               /* At one time, code such as "SELECT new.x" within a trigger would
-                                * cause this condition to run.  Since then, we have restructured how
-                                * trigger code is generated and so this condition is no longer
-                                * possible. However, it can still be true for statements like
-                                * the following:
-                                *
-                                *   CREATE TABLE t1(col INTEGER);
-                                *   SELECT (SELECT t1.col) FROM FROM t1;
-                                *
-                                * when columnType() is called on the expression "t1.col" in the
-                                * sub-select. In this case, set the column type to NULL, even
-                                * though it should really be "INTEGER".
-                                *
-                                * This is not a problem, as the column type of "t1.col" is never
-                                * used. When columnType() is called on the expression
-                                * "(SELECT t1.col)", the correct type is returned (see the TK_SELECT
-                                * branch below.
-                                */
-                               break;
-                       }
-
-                       assert(pTab && pExpr->space_def == pTab->def);
-                       if (pS) {
-                               /* The "table" is actually a sub-select or a view in the FROM clause
-                                * of the SELECT statement. Return the declaration type and origin
-                                * data for the result-set column of the sub-select.
-                                */
-                               assert(iCol >= 0);
-                               if (ALWAYS(iCol < pS->pEList->nExpr)) {
-                                       /* The ALWAYS() is because
-                                        * iCol>=pS->pEList->nExpr will have been
-                                        * caught already by name resolution.
-                                        */
-                                       NameContext sNC;
-                                       Expr *p = pS->pEList->a[iCol].pExpr;
-                                       sNC.pSrcList = pS->pSrc;
-                                       sNC.pNext = pNC;
-                                       sNC.pParse = pNC->pParse;
-                                       column_type =
-                                           columnType(&sNC, p, &zOrigTab,
-                                                      &zOrigCol);
-                               }
-                       } else if (pTab->pSchema) {
-                               /* A real table */
-                               assert(!pS);
-                               assert(iCol >= 0 &&
-                                      iCol < (int)pTab->def->field_count);
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-                               zOrigCol = pTab->def->fields[iCol].name;
-                               zType = pTab->def->fields[iCol].type;
-                               zOrigTab = pTab->zName;
-#else
-                               column_type = pTab->def->fields[iCol].type;
-#endif
-                       }
-                       break;
-               }
-       case TK_SELECT:{
-                       /* The expression is a sub-select. Return the declaration type and
-                        * origin info for the single column in the result set of the SELECT
-                        * statement.
-                        */
-                       NameContext sNC;
-                       Select *pS = pExpr->x.pSelect;
-                       Expr *p = pS->pEList->a[0].pExpr;
-                       assert(ExprHasProperty(pExpr, EP_xIsSelect));
-                       sNC.pSrcList = pS->pSrc;
-                       sNC.pNext = pNC;
-                       sNC.pParse = pNC->pParse;
-                       column_type =
-                           columnType(&sNC, p, &zOrigTab, &zOrigCol);
-                       break;
-               }
-       }
 
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-       if (pzOrigTab) {
-               assert(pzOrigTab && pzOrigCol);
-               *pzOrigTab = zOrigTab;
-               *pzOrigCol = zOrigCol;
-       }
-#endif
-                       NameContext sNC;
-                       Select *pS = pExpr->x.pSelect;
-                       Expr *p = pS->pEList->a[0].pExpr;
-                       assert(ExprHasProperty(pExpr, EP_xIsSelect));
-                       sNC.pSrcList = pS->pSrc;
-                       sNC.pNext = pNC;
-                       sNC.pParse = pNC->pParse;
-                       column_type =
-                           columnType(&sNC, p, &zOrigTab, &zOrigCol);
-                       break;
-               }
-       }
 
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-       if (pzOrigTab) {
-               assert(pzOrigTab && pzOrigCol);
-               *pzOrigTab = zOrigTab;
-               *pzOrigCol = zOrigCol;
-       }
-#endif
-       return column_type;
-}
 
 /*
  * Generate code that will tell the VDBE the names of columns
@@ -1950,15 +1819,12 @@ sqlite3SelectAddColumnTypeAndCollation(Parse * pParse,          /* Parsing contexts */
        sNC.pSrcList = pSelect->pSrc;
        a = pSelect->pEList->a;
        for (uint32_t i = 0; i < pTab->def->field_count; i++) {
-               enum field_type type;
                p = a[i].pExpr;
-               type = columnType(&sNC, p, 0, 0);
-               pTab->def->fields[i].type = type;
-
                char affinity = sqlite3ExprAffinity(p);
                if (affinity == 0)
                        affinity = AFFINITY_BLOB;
                pTab->def->fields[i].affinity = affinity;
+               pTab->def->fields[i].type = sql_affinity_to_field_type(affinity);
                bool is_found;
                uint32_t coll_id;
                if (pTab->def->fields[i].coll_id == COLL_NONE &&

diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index 7835be814..baf0dfef1 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -3466,6 +3468,9 @@ sql_create_view(struct Parse *parse_context, struct Token *begin,
                struct Token *name, struct ExprList *aliases,
                struct Select *select, bool if_exists);
 
+/**
+ * Helper to convert SQLite affinity to corresponding
+ * Tarantool field type.
+ **/
+enum field_type
+sql_affinity_to_field_type(enum affinity_type affinity);
+

>> +		return pExpr->space_def->fields[field_no].affinity;
>> +	}
>>  	return pExpr->affinity;
>>  }
>>  diff --git a/test/sql/on-conflict.result b/test/sql/on-conflict.result
>> index 63fe48e79..290aa4162 100644
>> --- a/test/sql/on-conflict.result
>> +++ b/test/sql/on-conflict.result
>> @@ -1,9 +1,17 @@
>>  test_run = require('test_run').new()
>>  ---
>>  ...
>> +---
>> +...
>> +---
>> +...
> 
> 3. wtf ???

Fixed. Also, two tables lack types, so I added them: 

--- a/test/sql/on-conflict.test.lua
+++ b/test/sql/on-conflict.test.lua
@@ -15,7 +15,7 @@ box.sql.execute("CREATE TABLE t2(a INT PRIMARY KEY ON CONFLICT IGNORE)")
 
 -- CHECK constraint is illegal with REPLACE option.
 --
-box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a CHECK (a > 5) ON CONFLICT REPLACE);")
+box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a INTEGER CHECK (a > 5) ON CONFLICT REPLACE);")
 
 --
 -- gh-3473: Primary key can't be declared with NULL.
@@ -27,7 +27,7 @@ box.sql.execute("CREATE TABLE test (a int, b int NULL, c int, PRIMARY KEY(a, b,
 
 -- Several NOT NULL REPLACE constraints work
 --
-box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a NOT NULL ON CONFLICT REPLACE DEFAULT 1, b NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
+box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a INT NOT NULL ON CONFLICT REPLACE DEFAULT 1, b INT NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
 box.sql.execute("INSERT INTO a VALUES(1, NULL, NULL);")
 box.sql.execute("INSERT INTO a VALUES(2, NULL, NULL);")
 box.sql.execute("SELECT * FROM a;")

--- a/test/sql/on-conflict.result
+++ b/test/sql/on-conflict.result
@@ -1,17 +1,9 @@
 test_run = require('test_run').new()
 ---
 ...
----
-...
----
-...
 engine = test_run:get_cfg('engine')
 ---
 ...
----
-...
----
-...
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ---
 ...
@@ -49,9 +41,9 @@ box.sql.execute("CREATE TABLE t2(a INT PRIMARY KEY ON CONFLICT IGNORE)")
 ...
 -- CHECK constraint is illegal with REPLACE option.
 --
-box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a CHECK (a > 5) ON CONFLICT REPLACE);")
+box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a INTEGER CHECK (a > 5) ON CONFLICT REPLACE);")
 ---
-- error: keyword "CHECK" is reserved
+- error: keyword "ON" is reserved
 ...
 --
 -- gh-3473: Primary key can't be declared with NULL.
@@ -75,25 +67,22 @@ box.sql.execute("CREATE TABLE test (a int, b int NULL, c int, PRIMARY KEY(a, b,
 ...
 -- Several NOT NULL REPLACE constraints work
 --
-box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a NOT NULL ON CONFLICT REPLACE DEFAULT 1, b NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
+box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a INT NOT NULL ON CONFLICT REPLACE DEFAULT 1, b INT NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
 ---
-- error: keyword "NOT" is reserved
 ...
 box.sql.execute("INSERT INTO a VALUES(1, NULL, NULL);")
 ---
-- error: 'no such table: A'
 ...
 box.sql.execute("INSERT INTO a VALUES(2, NULL, NULL);")
 ---
-- error: 'no such table: A'
 ...
 box.sql.execute("SELECT * FROM a;")
 ---
-- error: 'no such table: A'
+- - [1, 1, 2]
+  - [2, 1, 2]
 ...
 box.sql.execute("DROP TABLE a;")
 ---
-- error: 'no such table: A'
 ...
 -- gh-3566: UPDATE OR IGNORE causes deletion of old entry.
 --
diff --git a/test/sql/on-conflict.test.lua b/test/sql/on-conflict.test.lua
index b2d8e0589..aa58b854b 100644
--- a/test/sql/on-conflict.test.lua
+++ b/test/sql/on-conflict.test.lua
@@ -15,7 +15,7 @@ box.sql.execute("CREATE TABLE t2(a INT PRIMARY KEY ON CONFLICT IGNORE)")
 
 -- CHECK constraint is illegal with REPLACE option.
 --
-box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a CHECK (a > 5) ON CONFLICT REPLACE);")
+box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a INTEGER CHECK (a > 5) ON CONFLICT REPLACE);")
 
 --
 -- gh-3473: Primary key can't be declared with NULL.
@@ -27,7 +27,7 @@ box.sql.execute("CREATE TABLE test (a int, b int NULL, c int, PRIMARY KEY(a, b,
 
 -- Several NOT NULL REPLACE constraints work
 --
-box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a NOT NULL ON CONFLICT REPLACE DEFAULT 1, b NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
+box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a INT NOT NULL ON CONFLICT REPLACE DEFAULT 1, b INT NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
 box.sql.execute("INSERT INTO a VALUES(1, NULL, NULL);")
 box.sql.execute("INSERT INTO a VALUES(2, NULL, NULL);")
 box.sql.execute("SELECT * FROM a;”)

Whole patch:

diff --git a/extra/mkkeywordhash.c b/extra/mkkeywordhash.c
index 2c54c1835..1275b282c 100644
--- a/extra/mkkeywordhash.c
+++ b/extra/mkkeywordhash.c
@@ -109,6 +109,7 @@ static Keyword aKeywordTable[] = {
   { "BEFORE",                 "TK_BEFORE",      TRIGGER,          false },
   { "BEGIN",                  "TK_BEGIN",       TRIGGER,          true  },
   { "BETWEEN",                "TK_BETWEEN",     ALWAYS,           true  },
+  { "BLOB",                   "TK_BLOB",        RESERVED,         true  },
   { "BY",                     "TK_BY",          ALWAYS,           true  },
   { "CASCADE",                "TK_CASCADE",     FKEY,             false },
   { "CASE",                   "TK_CASE",        ALWAYS,           true  },
@@ -218,27 +219,29 @@ static Keyword aKeywordTable[] = {
   { "ASENSITIVE",             "TK_STANDARD",    RESERVED,         true  },
   { "BINARY",                 "TK_ID",          RESERVED,         true  },
   { "CALL",                   "TK_STANDARD",    RESERVED,         true  },
-  { "CHAR",                   "TK_ID",          RESERVED,         true  },
+  { "CHAR",                   "TK_CHAR",        RESERVED,         true  },
   { "CHARACTER",              "TK_ID",          RESERVED,         true  },
   { "CONDITION",              "TK_STANDARD",    RESERVED,         true  },
   { "CONNECT",                "TK_STANDARD",    RESERVED,         true  },
   { "CURRENT",                "TK_STANDARD",    RESERVED,         true  },
   { "CURRENT_USER",           "TK_STANDARD",    RESERVED,         true  },
   { "CURSOR",                 "TK_STANDARD",    RESERVED,         true  },
-  { "DATE",                   "TK_ID",          RESERVED,         true  },
-  { "DECIMAL",                "TK_ID",          RESERVED,         true  },
+  { "DATE",                   "TK_DATE",        RESERVED,         true  },
+  { "DATETIME",               "TK_DATETIME",    RESERVED,         true  },
+  { "DECIMAL",                "TK_DECIMAL",     RESERVED,         true  },
   { "DECLARE",                "TK_STANDARD",    RESERVED,         true  },
   { "DENSE_RANK",             "TK_STANDARD",    RESERVED,         true  },
   { "DESCRIBE",               "TK_STANDARD",    RESERVED,         true  },
   { "DETERMINISTIC",          "TK_STANDARD",    RESERVED,         true  },
-  { "DOUBLE",                 "TK_ID",          RESERVED,         true  },
+  { "DOUBLE",                 "TK_DOUBLE",      RESERVED,         true  },
   { "ELSEIF",                 "TK_STANDARD",    RESERVED,         true  },
   { "FETCH",                  "TK_STANDARD",    RESERVED,         true  },
-  { "FLOAT",                  "TK_ID",          RESERVED,         true  },
+  { "FLOAT",                  "TK_FLOAT",       RESERVED,         true  },
   { "FUNCTION",               "TK_STANDARD",    RESERVED,         true  },
   { "GET",                    "TK_STANDARD",    RESERVED,         true  },
   { "GRANT",                  "TK_STANDARD",    RESERVED,         true  },
-  { "INTEGER",                "TK_ID",          RESERVED,         true  },
+  { "INT",                    "TK_INT",         RESERVED,         true  },
+  { "INTEGER",                "TK_INTEGER",     RESERVED,         true  },
   { "INOUT",                  "TK_STANDARD",    RESERVED,         true  },
   { "INSENSITIVE",            "TK_STANDARD",    RESERVED,         true  },
   { "ITERATE",                "TK_STANDARD",    RESERVED,         true  },
@@ -246,6 +249,8 @@ static Keyword aKeywordTable[] = {
   { "LOCALTIME",              "TK_STANDARD",    RESERVED,         true  },
   { "LOCALTIMESTAMP",         "TK_STANDARD",    RESERVED,         true  },
   { "LOOP",                   "TK_STANDARD",    RESERVED,         true  },
+  { "NUM",                    "TK_NUM",         RESERVED,         true  },
+  { "NUMERIC",                "TK_NUMERIC",     RESERVED,         true  },
   { "OUT",                    "TK_STANDARD",    RESERVED,         true  },
   { "OVER",                   "TK_STANDARD",    RESERVED,         true  },
   { "PARTITION",              "TK_STANDARD",    RESERVED,         true  },
@@ -254,6 +259,7 @@ static Keyword aKeywordTable[] = {
   { "RANGE",                  "TK_STANDARD",    RESERVED,         true  },
   { "RANK",                   "TK_STANDARD",    RESERVED,         true  },
   { "READS",                  "TK_STANDARD",    RESERVED,         true  },
+  { "REAL",                   "TK_REAL",        RESERVED,         true  },
   { "REPEAT",                 "TK_STANDARD",    RESERVED,         true  },
   { "RESIGNAL",               "TK_STANDARD",    RESERVED,         true  },
   { "RETURN",                 "TK_STANDARD",    RESERVED,         true  },
@@ -267,9 +273,10 @@ static Keyword aKeywordTable[] = {
   { "SYSTEM",                 "TK_STANDARD",    RESERVED,         true  },
   { "SQL",                    "TK_STANDARD",    RESERVED,         true  },
   { "USER",                   "TK_STANDARD",    RESERVED,         true  },
-  { "VARCHAR",                "TK_ID",          RESERVED,         true  },
+  { "VARCHAR",                "TK_VARCHAR",     RESERVED,         true  },
   { "WHENEVER",               "TK_STANDARD",    RESERVED,         true  },
   { "WHILE",                  "TK_STANDARD",    RESERVED,         true  },
+  { "TEXT",                   "TK_TEXT",        RESERVED,         true  },
   { "TRUNCATE",               "TK_TRUNCATE",    ALWAYS,           true  },
 };
 
diff --git a/src/box/sql.c b/src/box/sql.c
index c7b87e57a..c081535e4 100644
--- a/src/box/sql.c
+++ b/src/box/sql.c
@@ -1124,35 +1124,6 @@ cursor_advance(BtCursor *pCur, int *pRes)
  * format data for certain fields in _space and _index.
  */
 
-/*
- * Convert SQLite affinity value to the corresponding Tarantool type
- * string which is suitable for _index.parts field.
- */
-static const char *convertSqliteAffinity(int affinity, bool allow_nulls)
-{
-	if (allow_nulls || 1) {
-		return "scalar";
-	}
-	switch (affinity) {
-	default:
-		assert(false);
-	case AFFINITY_BLOB:
-		return "scalar";
-	case AFFINITY_TEXT:
-		return "string";
-	case AFFINITY_NUMERIC:
-	case AFFINITY_REAL:
-	  /* Tarantool workaround: to make comparators able to compare, e.g.
-	     double and int use generic type. This might be a performance issue.  */
-	  /* return "number"; */
-		return "scalar";
-	case AFFINITY_INTEGER:
-	  /* See comment above.  */
-	  /* return "integer"; */
-		return "scalar";
-	}
-}
-
 char *
 sql_encode_table(struct region *region, struct Table *table, uint32_t *size)
 {
@@ -1164,21 +1135,9 @@ sql_encode_table(struct region *region, struct Table *table, uint32_t *size)
 
 	const struct space_def *def = table->def;
 	assert(def != NULL);
-	/*
-	 * If table's PK is single column which is INTEGER, then
-	 * treat it as strict type, not affinity.
-	 */
-	struct index *pk_idx = sql_table_primary_key(table);
-	uint32_t pk_forced_int = UINT32_MAX;
-	if (pk_idx != NULL && pk_idx->def->key_def->part_count == 1) {
-		int pk = pk_idx->def->key_def->parts[0].fieldno;
-		if (def->fields[pk].type == FIELD_TYPE_INTEGER)
-			pk_forced_int = pk;
-	}
 	uint32_t field_count = def->field_count;
 	mpstream_encode_array(&stream, field_count);
 	for (uint32_t i = 0; i < field_count && !is_error; i++) {
-		const char *t;
 		uint32_t cid = def->fields[i].coll_id;
 		struct field_def *field = &def->fields[i];
 		const char *default_str = field->default_value;
@@ -1191,22 +1150,15 @@ sql_encode_table(struct region *region, struct Table *table, uint32_t *size)
 		mpstream_encode_str(&stream, "name");
 		mpstream_encode_str(&stream, field->name);
 		mpstream_encode_str(&stream, "type");
-		if (i == pk_forced_int) {
-			t = "integer";
-		} else {
-			enum affinity_type affinity = def->fields[i].affinity;
-			t = affinity == AFFINITY_BLOB ? "scalar" :
-			    convertSqliteAffinity(affinity,
-						  def->fields[i].is_nullable);
-		}
 		assert(def->fields[i].is_nullable ==
 		       action_is_nullable(def->fields[i].nullable_action));
-		mpstream_encode_str(&stream, t);
+		mpstream_encode_str(&stream, field_type_strs[field->type]);
 		mpstream_encode_str(&stream, "affinity");
 		mpstream_encode_uint(&stream, def->fields[i].affinity);
 		mpstream_encode_str(&stream, "is_nullable");
 		mpstream_encode_bool(&stream, def->fields[i].is_nullable);
 		mpstream_encode_str(&stream, "nullable_action");
+
 		assert(def->fields[i].nullable_action < on_conflict_action_MAX);
 		const char *action =
 			on_conflict_action_strs[def->fields[i].nullable_action];
@@ -1320,31 +1272,13 @@ fkey_encode_links(struct region *region, const struct fkey_def *def, int type,
 
 char *
 sql_encode_index_parts(struct region *region, const struct field_def *fields,
-		       const struct index_def *idx_def,
-		       const struct index_def *pk_def, uint32_t *size)
+		       const struct index_def *idx_def, uint32_t *size)
 {
 	size_t used = region_used(region);
 	struct mpstream stream;
 	bool is_error = false;
 	mpstream_init(&stream, region, region_reserve_cb, region_alloc_cb,
 		      set_encode_error, &is_error);
-	/*
-	 * If table's PK is single column which is INTEGER, then
-	 * treat it as strict type, not affinity.
-	 */
-	uint32_t pk_forced_int = UINT32_MAX;
-	if (pk_def->key_def->part_count == 1) {
-		int pk = pk_def->key_def->parts[0].fieldno;
-		if (fields[pk].type == FIELD_TYPE_INTEGER)
-			pk_forced_int = pk;
-	}
-
-	/* gh-2187
-	 *
-	 * Include all index columns, i.e. "key" columns followed by the
-	 * primary key columns. Query planner depends on this particular
-	 * data layout.
-	 */
 	struct key_def *key_def = idx_def->key_def;
 	struct key_part *part = key_def->parts;
 	mpstream_encode_array(&stream, key_def->part_count);
@@ -1352,20 +1286,14 @@ sql_encode_index_parts(struct region *region, const struct field_def *fields,
 		uint32_t col = part->fieldno;
 		assert(fields[col].is_nullable ==
 		       action_is_nullable(fields[col].nullable_action));
-		const char *t;
-		if (pk_forced_int == col) {
-			t = "integer";
-		} else {
-			t = convertSqliteAffinity(fields[col].affinity,
-						  fields[col].is_nullable);
-		}
 		/* Do not decode default collation. */
 		uint32_t cid = part->coll_id;
 		mpstream_encode_map(&stream, 5 + (cid != COLL_NONE));
 		mpstream_encode_str(&stream, "type");
-		mpstream_encode_str(&stream, t);
+		mpstream_encode_str(&stream, field_type_strs[fields[col].type]);
 		mpstream_encode_str(&stream, "field");
 		mpstream_encode_uint(&stream, col);
+
 		if (cid != COLL_NONE) {
 			mpstream_encode_str(&stream, "collation");
 			mpstream_encode_uint(&stream, cid);
diff --git a/src/box/sql/build.c b/src/box/sql/build.c
index a806fb4b3..51f28e340 100644
--- a/src/box/sql/build.c
+++ b/src/box/sql/build.c
@@ -402,6 +402,22 @@ sql_field_retrieve(Parse *parser, Table *table, uint32_t id)
 	return field;
 }
 
+enum field_type
+sql_affinity_to_field_type(enum affinity_type affinity)
+{
+	switch (affinity) {
+		case AFFINITY_INTEGER:
+			return FIELD_TYPE_INTEGER;
+		case AFFINITY_REAL:
+		case AFFINITY_NUMERIC:
+			return FIELD_TYPE_NUMBER;
+		case AFFINITY_TEXT:
+			return FIELD_TYPE_STRING;
+		default:
+			return FIELD_TYPE_SCALAR;
+	}
+}
+
 /*
  * Add a new column to the table currently being constructed.
  *
@@ -411,12 +427,12 @@ sql_field_retrieve(Parse *parser, Table *table, uint32_t id)
  * column.
  */
 void
-sqlite3AddColumn(Parse * pParse, Token * pName, Token * pType)
+sqlite3AddColumn(Parse * pParse, Token * pName, struct type_def *type_def)
 {
+	assert(type_def != NULL);
 	Table *p;
 	int i;
 	char *z;
-	char *zType;
 	sqlite3 *db = pParse->db;
 	if ((p = pParse->pNewTable) == 0)
 		return;
@@ -464,35 +480,8 @@ sqlite3AddColumn(Parse * pParse, Token * pName, Token * pType)
 	 */
 	column_def->nullable_action = ON_CONFLICT_ACTION_DEFAULT;
 	column_def->is_nullable = true;
-
-	if (pType->n == 0) {
-		/* If there is no type specified, columns have the default affinity
-		 * 'BLOB' and type SCALAR.
-		 * TODO: since SQL standard prohibits column creation without
-		 * specified type, the code below should emit an error.
-		 */
-		column_def->affinity = AFFINITY_BLOB;
-		column_def->type = FIELD_TYPE_SCALAR;
-	} else {
-		/* TODO: convert string of type into runtime
-		 * FIELD_TYPE value for other types.
-		 */
-		if ((sqlite3StrNICmp(pType->z, "INTEGER", 7) == 0 &&
-		     pType->n == 7) ||
-		    (sqlite3StrNICmp(pType->z, "INT", 3) == 0 &&
-		     pType->n == 3)) {
-			column_def->type = FIELD_TYPE_INTEGER;
-			column_def->affinity = AFFINITY_INTEGER;
-		} else {
-			zType = sqlite3_malloc(pType->n + 1);
-			memcpy(zType, pType->z, pType->n);
-			zType[pType->n] = 0;
-			sqlite3Dequote(zType);
-			column_def->affinity = sqlite3AffinityType(zType, 0);
-			column_def->type = FIELD_TYPE_SCALAR;
-			sqlite3_free(zType);
-		}
-	}
+	column_def->affinity = type_def->type;
+	column_def->type = sql_affinity_to_field_type(column_def->affinity);
 	p->def->field_count++;
 	pParse->constraintName.n = 0;
 }
@@ -1045,8 +1034,7 @@ getNewSpaceId(Parse * pParse)
  */
 static void
 vdbe_emit_create_index(struct Parse *parse, struct space_def *def,
-		       const struct index_def *idx_def,
-		       const struct index_def *pk_def, int space_id_reg,
+		       const struct index_def *idx_def, int space_id_reg,
 		       int index_id_reg)
 {
 	struct Vdbe *v = sqlite3GetVdbe(parse);
@@ -1065,7 +1053,7 @@ vdbe_emit_create_index(struct Parse *parse, struct space_def *def,
 		goto error;
 	uint32_t index_parts_sz = 0;
 	char *index_parts = sql_encode_index_parts(region, def->fields, idx_def,
-						   pk_def, &index_parts_sz);
+						   &index_parts_sz);
 	if (index_parts == NULL)
 		goto error;
 	char *raw = sqlite3DbMallocRaw(parse->db,
@@ -1466,12 +1454,10 @@ sqlite3EndTable(Parse * pParse,	/* Parse context */
 	createSpace(pParse, reg_space_id, stmt);
 	/* Indexes aren't required for VIEW's.. */
 	if (!p->def->opts.is_view) {
-		struct index *pk = sql_table_primary_key(p);
 		for (uint32_t i = 0; i < p->space->index_count; ++i) {
 			struct index *idx = p->space->index[i];
 			vdbe_emit_create_index(pParse, p->def, idx->def,
-					       pk->def, reg_space_id,
-					       idx->def->iid);
+					       reg_space_id, idx->def->iid);
 		}
 	}
 
@@ -2701,8 +2687,7 @@ sql_create_index(struct Parse *parse, struct Token *token,
 		assert(start != NULL);
 		int index_id = getNewIid(parse, def->id, cursor);
 		sqlite3VdbeAddOp1(vdbe, OP_Close, cursor);
-		struct index *pk = space_index(space, 0);
-		vdbe_emit_create_index(parse, def, index->def, pk->def,
+		vdbe_emit_create_index(parse, def, index->def,
 				       def->id, index_id);
 		sqlite3VdbeAddOp0(vdbe, OP_Expire);
 	}
diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c
index af5f3e560..95704979e 100644
--- a/src/box/sql/expr.c
+++ b/src/box/sql/expr.c
@@ -72,32 +72,50 @@ sqlite3TableColumnAffinity(struct space_def *def, int idx)
 char
 sqlite3ExprAffinity(Expr * pExpr)
 {
-	int op;
 	pExpr = sqlite3ExprSkipCollate(pExpr);
 	if (pExpr->flags & EP_Generic)
 		return 0;
-	op = pExpr->op;
-	if (op == TK_SELECT) {
-		assert(pExpr->flags & EP_xIsSelect);
-		return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].
-					   pExpr);
-	}
+	uint8_t op = pExpr->op;
 	if (op == TK_REGISTER)
 		op = pExpr->op2;
-#ifndef SQLITE_OMIT_CAST
-	if (op == TK_CAST) {
+	switch (op) {
+	case TK_SELECT:
+		assert(pExpr->flags & EP_xIsSelect);
+		return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr);
+	case TK_CAST:
 		assert(!ExprHasProperty(pExpr, EP_IntValue));
-		return sqlite3AffinityType(pExpr->u.zToken, 0);
-	}
-#endif
-	if (op == TK_AGG_COLUMN || op == TK_COLUMN) {
+		return pExpr->affinity;
+	case TK_AGG_COLUMN:
+	case TK_COLUMN:
+		assert(pExpr->iColumn >= 0);
 		return sqlite3TableColumnAffinity(pExpr->space_def,
 						  pExpr->iColumn);
-	}
-	if (op == TK_SELECT_COLUMN) {
+	case TK_SELECT_COLUMN:
 		assert(pExpr->pLeft->flags & EP_xIsSelect);
 		return sqlite3ExprAffinity(pExpr->pLeft->x.pSelect->pEList->
-					   a[pExpr->iColumn].pExpr);
+			a[pExpr->iColumn].pExpr);
+	case TK_PLUS:
+	case TK_MINUS:
+	case TK_STAR:
+	case TK_SLASH:
+		assert(pExpr->pRight != NULL && pExpr->pLeft != NULL);
+		enum affinity_type lhs_aff = sqlite3ExprAffinity(pExpr->pLeft);
+		enum affinity_type rhs_aff = sqlite3ExprAffinity(pExpr->pRight);
+		return sql_affinity_result(rhs_aff, lhs_aff);
+	case TK_LT:
+	case TK_GT:
+	case TK_EQ:
+	case TK_LE:
+	case TK_NE:
+	case TK_NOT:
+	case TK_AND:
+	case TK_OR:
+		/*
+		 * FIXME: should be changed to BOOL type or
+		 * affinity when it is implemented. Now simply
+		 * return INTEGER.
+		 */
+		return AFFINITY_INTEGER;
 	}
 	return pExpr->affinity;
 }
@@ -228,15 +246,9 @@ sql_expr_coll(Parse *parse, Expr *p, bool *is_found, uint32_t *coll_id)
 	return coll;
 }
 
-/*
- * pExpr is an operand of a comparison operator.  aff2 is the
- * type affinity of the other operand.  This routine returns the
- * type affinity that should be used for the comparison operator.
- */
-char
-sqlite3CompareAffinity(Expr * pExpr, char aff2)
+enum affinity_type
+sql_affinity_result(enum affinity_type aff1, enum affinity_type aff2)
 {
-	char aff1 = sqlite3ExprAffinity(pExpr);
 	if (aff1 && aff2) {
 		/* Both sides of the comparison are columns. If one has numeric
 		 * affinity, use that. Otherwise use no affinity.
@@ -273,11 +285,12 @@ comparisonAffinity(Expr * pExpr)
 	assert(pExpr->pLeft);
 	aff = sqlite3ExprAffinity(pExpr->pLeft);
 	if (pExpr->pRight) {
-		aff = sqlite3CompareAffinity(pExpr->pRight, aff);
+		enum affinity_type rhs_aff = sqlite3ExprAffinity(pExpr->pRight);
+		aff = sql_affinity_result(rhs_aff, aff);
 	} else if (ExprHasProperty(pExpr, EP_xIsSelect)) {
-		aff =
-		    sqlite3CompareAffinity(pExpr->x.pSelect->pEList->a[0].pExpr,
-					   aff);
+		enum affinity_type rhs_aff =
+			sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr);
+		aff = sql_affinity_result(rhs_aff, aff);
 	} else {
 		aff = AFFINITY_BLOB;
 	}
@@ -311,8 +324,10 @@ sqlite3IndexAffinityOk(Expr * pExpr, char idx_affinity)
 static u8
 binaryCompareP5(Expr * pExpr1, Expr * pExpr2, int jumpIfNull)
 {
-	u8 aff = (char)sqlite3ExprAffinity(pExpr2);
-	aff = (u8) sqlite3CompareAffinity(pExpr1, aff) | (u8) jumpIfNull;
+	enum affinity_type aff2 = sqlite3ExprAffinity(pExpr2);
+	enum affinity_type aff1 = sqlite3ExprAffinity(pExpr1);
+	enum affinity_type aff = sql_affinity_result(aff1, aff2) |
+				 (u8) jumpIfNull;
 	return aff;
 }
 
@@ -2313,11 +2328,12 @@ sqlite3FindInIndex(Parse * pParse,	/* Parsing context */
 		   u32 inFlags,	/* IN_INDEX_LOOP, _MEMBERSHIP, and/or _NOOP_OK */
 		   int *prRhsHasNull,	/* Register holding NULL status.  See notes */
 		   int *aiMap,	/* Mapping from Index fields to RHS fields */
-		   int *pSingleIdxCol	/* Tarantool. In case (nExpr == 1) it is meant by SQLite that
+		   int *pSingleIdxCol,	/* Tarantool. In case (nExpr == 1) it is meant by SQLite that
 					   column of interest is always 0, since index columns appear first
 					   in index. This is not the case for Tarantool, where index columns
 					   don't change order of appearance.
 					   So, use this field to store single column index.  */
+		   struct index_def **pUseIdx  /* Index to use. */
     )
 {
 	Select *p;		/* SELECT to the right of IN operator */
@@ -2325,6 +2341,8 @@ sqlite3FindInIndex(Parse * pParse,	/* Parsing context */
 	int iTab = pParse->nTab++;	/* Cursor of the RHS table */
 	int mustBeUnique;	/* True if RHS must be unique */
 	Vdbe *v = sqlite3GetVdbe(pParse);	/* Virtual machine being coded */
+	if (pUseIdx)
+		*pUseIdx = NULL;
 
 	assert(pX->op == TK_IN);
 	mustBeUnique = (inFlags & IN_INDEX_LOOP) != 0;
@@ -2377,14 +2395,15 @@ sqlite3FindInIndex(Parse * pParse,	/* Parsing context */
 			/* RHS table */
 			char idxaff =
 				sqlite3TableColumnAffinity(pTab->def, iCol);
-			char cmpaff = sqlite3CompareAffinity(pLhs, idxaff);
+			enum affinity_type lhs_aff = sqlite3ExprAffinity(pLhs);
+			char cmpaff = sql_affinity_result(lhs_aff, idxaff);
 			testcase(cmpaff == AFFINITY_BLOB);
 			testcase(cmpaff == AFFINITY_TEXT);
 			switch (cmpaff) {
 			case AFFINITY_BLOB:
 				break;
 			case AFFINITY_TEXT:
-				/* sqlite3CompareAffinity() only returns TEXT if one side or the
+				/* sql_affinity_result() only returns TEXT if one side or the
 				 * other has no affinity and the other side is TEXT.  Hence,
 				 * the only way for cmpaff to be TEXT is for idxaff to be TEXT
 				 * and for the term on the LHS of the IN to have no affinity.
@@ -2469,6 +2488,8 @@ sqlite3FindInIndex(Parse * pParse,	/* Parsing context */
 				       || colUsed != (MASKBIT(nExpr) - 1));
 				if (colUsed == (MASKBIT(nExpr) - 1)) {
 					/* If we reach this point, that means the index pIdx is usable */
+					if (pUseIdx)
+						*pUseIdx = idx->def;
 					int iAddr = sqlite3VdbeAddOp0(v, OP_Once);
 					VdbeCoverage(v);
 					sqlite3VdbeAddOp4(v, OP_Explain,
@@ -2584,9 +2605,9 @@ exprINAffinity(Parse * pParse, Expr * pExpr)
 			Expr *pA = sqlite3VectorFieldSubexpr(pLeft, i);
 			char a = sqlite3ExprAffinity(pA);
 			if (pSelect) {
-				zRet[i] =
-				    sqlite3CompareAffinity(pSelect->pEList->
-							   a[i].pExpr, a);
+				struct Expr *e = pSelect->pEList->a[i].pExpr;
+				enum affinity_type aff = sqlite3ExprAffinity(e);
+				zRet[i] = sql_affinity_result(aff, a);
 			} else {
 				zRet[i] = a;
 			}
@@ -2971,6 +2992,7 @@ sqlite3ExprCodeIN(Parse * pParse,	/* Parsing and code generating context */
 	int addrTruthOp;	/* Address of opcode that determines the IN is true */
 	int destNotNull;	/* Jump here if a comparison is not true in step 6 */
 	int addrTop;		/* Top of the step-6 loop */
+	struct index_def *pUseIndex; /* Index to use. */
 
 	pLeft = pExpr->pLeft;
 	if (sqlite3ExprCheckIN(pParse, pExpr))
@@ -2995,7 +3017,7 @@ sqlite3ExprCodeIN(Parse * pParse,	/* Parsing and code generating context */
 	eType = sqlite3FindInIndex(pParse, pExpr,
 				   IN_INDEX_MEMBERSHIP | IN_INDEX_NOOP_OK,
 				   destIfFalse == destIfNull ? 0 : &rRhsHasNull,
-				   aiMap, 0);
+				   aiMap, 0, &pUseIndex);
 
 	assert(pParse->nErr || nVector == 1 || eType == IN_INDEX_EPH
 	       || eType == IN_INDEX_INDEX_ASC || eType == IN_INDEX_INDEX_DESC);
@@ -3118,19 +3140,19 @@ sqlite3ExprCodeIN(Parse * pParse,	/* Parsing and code generating context */
 	sqlite3VdbeAddOp4(v, OP_Affinity, rLhs, nVector, 0, zAff,
 			  nVector);
 	if ((pExpr->flags & EP_xIsSelect)
-	    && !pExpr->is_ephemeral) {
+	    && !pExpr->is_ephemeral && pUseIndex != NULL) {
 		struct SrcList *src_list = pExpr->x.pSelect->pSrc;
 		assert(src_list->nSrc == 1);
 
 		struct Table *tab = src_list->a[0].pTab;
 		assert(tab != NULL);
-		struct index *pk = space_index(tab->space, 0);
+		struct index_def *pk = pUseIndex;
 		assert(pk != NULL);
 
-		uint32_t fieldno = pk->def->key_def->parts[0].fieldno;
+		uint32_t fieldno = pk->key_def->parts[0].fieldno;
 		enum affinity_type affinity =
 			tab->def->fields[fieldno].affinity;
-		if (pk->def->key_def->part_count == 1 &&
+		if (pk->key_def->part_count == 1 &&
 		    affinity == AFFINITY_INTEGER && (int)fieldno < nVector) {
 			int reg_pk = rLhs + (int)fieldno;
 			sqlite3VdbeAddOp2(v, OP_MustBeInt, reg_pk, destIfFalse);
@@ -3749,9 +3771,7 @@ sqlite3ExprCodeTarget(Parse * pParse, Expr * pExpr, int target)
 				sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target);
 				inReg = target;
 			}
-			sqlite3VdbeAddOp2(v, OP_Cast, target,
-					  sqlite3AffinityType(pExpr->u.zToken,
-							      0));
+			sqlite3VdbeAddOp2(v, OP_Cast, target, pExpr->affinity);
 			testcase(usedAsColumnCache(pParse, inReg, inReg));
 			sqlite3ExprCacheAffinityChange(pParse, inReg, 1);
 			return inReg;
diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y
index 90d22aca6..abaa73736 100644
--- a/src/box/sql/parse.y
+++ b/src/box/sql/parse.y
@@ -185,7 +185,7 @@ create_table_args ::= AS select(S). {
 }
 columnlist ::= columnlist COMMA columnname carglist.
 columnlist ::= columnname carglist.
-columnname(A) ::= nm(A) typetoken(Y). {sqlite3AddColumn(pParse,&A,&Y);}
+columnname(A) ::= nm(A) typedef(Y). {sqlite3AddColumn(pParse,&A,&Y);}
 
 // An IDENTIFIER can be a generic identifier, or one of several
 // keywords.  Any non-standard keyword can also be an identifier.
@@ -229,25 +229,6 @@ nm(A) ::= id(A). {
   }
 }
 
-// A typetoken is really zero or more tokens that form a type name such
-// as can be found after the column name in a CREATE TABLE statement.
-// Multiple tokens are concatenated to form the value of the typetoken.
-//
-%type typetoken {Token}
-typetoken(A) ::= .   {A.n = 0; A.z = 0;}
-typetoken(A) ::= typename(A).
-typetoken(A) ::= typename(A) LP signed RP(Y). {
-  A.n = (int)(&Y.z[Y.n] - A.z);
-}
-typetoken(A) ::= typename(A) LP signed COMMA signed RP(Y). {
-  A.n = (int)(&Y.z[Y.n] - A.z);
-}
-%type typename {Token}
-typename(A) ::= ids(A).
-typename(A) ::= typename(A) ids(Y). {A.n=Y.n+(int)(Y.z-A.z);}
-signed ::= plus_num.
-signed ::= minus_num.
-
 // "carglist" is a list of additional constraints that come after the
 // column name and column type in a CREATE TABLE statement.
 //
@@ -837,6 +818,20 @@ idlist(A) ::= nm(Y).
     Expr *p = sqlite3DbMallocRawNN(pParse->db, sizeof(Expr)+t.n+1);
     if( p ){
       memset(p, 0, sizeof(Expr));
+      switch (op) {
+      case TK_STRING:
+        p->affinity = AFFINITY_TEXT;
+        break;
+      case TK_BLOB:
+        p->affinity = AFFINITY_BLOB;
+        break;
+      case TK_INTEGER:
+        p->affinity = AFFINITY_INTEGER;
+        break;
+      case TK_FLOAT:
+        p->affinity = AFFINITY_REAL;
+        break;
+      }
       p->op = (u8)op;
       p->flags = EP_Leaf;
       p->iAgg = -1;
@@ -872,6 +867,7 @@ term(A) ::= FLOAT|BLOB(X). {spanExpr(&A,pParse, at X,X);/*A-overwrites-X*/}
 term(A) ::= STRING(X).     {spanExpr(&A,pParse, at X,X);/*A-overwrites-X*/}
 term(A) ::= INTEGER(X). {
   A.pExpr = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &X, 1);
+  A.pExpr->affinity = AFFINITY_INTEGER;
   A.zStart = X.z;
   A.zEnd = X.z + X.n;
   if( A.pExpr ) A.pExpr->flags |= EP_Leaf;
@@ -901,9 +897,10 @@ expr(A) ::= expr(A) COLLATE id(C). {
   A.zEnd = &C.z[C.n];
 }
 %ifndef SQLITE_OMIT_CAST
-expr(A) ::= CAST(X) LP expr(E) AS typetoken(T) RP(Y). {
+expr(A) ::= CAST(X) LP expr(E) AS typedef(T) RP(Y). {
   spanSet(&A,&X,&Y); /*A-overwrites-X*/
-  A.pExpr = sqlite3ExprAlloc(pParse->db, TK_CAST, &T, 1);
+  A.pExpr = sqlite3ExprAlloc(pParse->db, TK_CAST, 0, 1);
+  A.pExpr->affinity = T.type;
   sqlite3ExprAttachSubtrees(pParse->db, A.pExpr, E.pExpr, 0);
 }
 %endif  SQLITE_OMIT_CAST
@@ -917,6 +914,21 @@ expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP(E). {
     A.pExpr->flags |= EP_Distinct;
   }
 }
+
+type_func(A) ::= DATE(A) .
+type_func(A) ::= DATETIME(A) .
+type_func(A) ::= CHAR(A) .
+expr(A) ::= type_func(X) LP distinct(D) exprlist(Y) RP(E). {
+  if( Y && Y->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
+    sqlite3ErrorMsg(pParse, "too many arguments on function %T", &X);
+  }
+  A.pExpr = sqlite3ExprFunction(pParse, Y, &X);
+  spanSet(&A,&X,&E);
+  if( D==SF_Distinct && A.pExpr ){
+    A.pExpr->flags |= EP_Distinct;
+  }
+}
+
 expr(A) ::= id(X) LP STAR RP(E). {
   A.pExpr = sqlite3ExprFunction(pParse, 0, &X);
   spanSet(&A,&X,&E);
@@ -1410,7 +1422,7 @@ expr(A) ::= RAISE(X) LP IGNORE RP(Y).  {
 }
 expr(A) ::= RAISE(X) LP raisetype(T) COMMA STRING(Z) RP(Y).  {
   spanSet(&A,&X,&Y);  /*A-overwrites-X*/
-  A.pExpr = sqlite3ExprAlloc(pParse->db, TK_RAISE, &Z, 1); 
+  A.pExpr = sqlite3ExprAlloc(pParse->db, TK_RAISE, &Z, 1);
   if( A.pExpr ) {
     A.pExpr->on_conflict_action = (enum on_conflict_action) T;
   }
@@ -1464,3 +1476,45 @@ wqlist(A) ::= wqlist(A) COMMA nm(X) eidlist_opt(Y) AS LP select(Z) RP. {
   A = sqlite3WithAdd(pParse, A, &X, Y, Z);
 }
 %endif  SQLITE_OMIT_CTE
+
+/* Primitive types. */
+%type typedef {struct type_def}
+typedef(A) ::= TEXT . { A.type = AFFINITY_TEXT; }
+typedef(A) ::= BLOB . { A.type = AFFINITY_BLOB; }
+typedef(A) ::= DATE . { A.type = AFFINITY_REAL; }
+typedef(A) ::= TIME . { A.type = AFFINITY_REAL; }
+typedef(A) ::= DATETIME . { A.type = AFFINITY_REAL; }
+
+%type char_len_typedef {struct type_def}
+typedef(A) ::= CHAR|VARCHAR char_len_typedef(B) . {
+  A.type = AFFINITY_TEXT;
+  (void) B;
+}
+
+char_len_typedef(A) ::= LP INTEGER(B) RP . {
+  (void) A;
+  (void) B;
+}
+
+%type number_typedef {struct type_def}
+typedef(A) ::= number_typedef(A) .
+number_typedef(A) ::= FLOAT|REAL|DOUBLE . { A.type = AFFINITY_REAL; }
+number_typedef(A) ::= INT|INTEGER . { A.type = AFFINITY_INTEGER; }
+
+%type number_len_typedef {struct type_def}
+number_typedef(A) ::= DECIMAL|NUMERIC|NUM number_len_typedef(B) . {
+  A.type = AFFINITY_REAL;
+  (void) B;
+}
+
+number_len_typedef(A) ::= . { (void) A; }
+number_len_typedef(A) ::= LP INTEGER(B) RP . {
+  (void) A;
+  (void) B;
+}
+
+number_len_typedef(A) ::= LP INTEGER(B) COMMA INTEGER(C) RP . {
+  (void) A;
+  (void) B;
+  (void) C;
+}
diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 77e0c5d66..505c0616c 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1664,162 +1664,6 @@ generateSortTail(Parse * pParse,	/* Parsing context */
 	sqlite3VdbeResolveLabel(v, addrBreak);
 }
 
-/*
- * Return a pointer to a string containing the 'declaration type' of the
- * expression pExpr. The string may be treated as static by the caller.
- *
- * Also try to estimate the size of the returned value and return that
- * result in *pEstWidth.
- *
- * The declaration type is the exact datatype definition extracted from the
- * original CREATE TABLE statement if the expression is a column.
- * Exactly when an expression is considered a column can be complex
- * in the presence of subqueries. The result-set expression in all
- * of the following SELECT statements is considered a column by this function.
- *
- *   SELECT col FROM tbl;
- *   SELECT (SELECT col FROM tbl;
- *   SELECT (SELECT col FROM tbl);
- *   SELECT abc FROM (SELECT col AS abc FROM tbl);
- *
- * The declaration type for any expression other than a column is NULL.
- *
- * This routine has either 3 or 6 parameters depending on whether or not
- * the SQLITE_ENABLE_COLUMN_METADATA compile-time option is used.
- */
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-#define columnType(A,B,C,D) columnTypeImpl(A,B,C,D)
-#else				/* if !defined(SQLITE_ENABLE_COLUMN_METADATA) */
-#define columnType(A,B,C,D) columnTypeImpl(A,B)
-#endif
-static enum field_type
-columnTypeImpl(NameContext * pNC, Expr * pExpr
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-	       , const char **pzOrigCol,
-#endif
-)
-{
-	enum field_type column_type = FIELD_TYPE_SCALAR;
-	int j;
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-	char const *zOrigTab = 0;
-	char const *zOrigCol = 0;
-#endif
-
-	assert(pExpr != 0);
-	assert(pNC->pSrcList != 0);
-	switch (pExpr->op) {
-	case TK_AGG_COLUMN:
-	case TK_COLUMN:{
-			/* The expression is a column. Locate the table the column is being
-			 * extracted from in NameContext.pSrcList. This table may be real
-			 * database table or a subquery.
-			 */
-			Table *pTab = 0;	/* Table structure column is extracted from */
-			Select *pS = 0;	/* Select the column is extracted from */
-			int iCol = pExpr->iColumn;	/* Index of column in pTab */
-			testcase(pExpr->op == TK_AGG_COLUMN);
-			testcase(pExpr->op == TK_COLUMN);
-			while (pNC && !pTab) {
-				SrcList *pTabList = pNC->pSrcList;
-				for (j = 0;
-				     j < pTabList->nSrc
-				     && pTabList->a[j].iCursor != pExpr->iTable;
-				     j++) ;
-				if (j < pTabList->nSrc) {
-					pTab = pTabList->a[j].pTab;
-					pS = pTabList->a[j].pSelect;
-				} else {
-					pNC = pNC->pNext;
-				}
-			}
-
-			if (pTab == 0) {
-				/* At one time, code such as "SELECT new.x" within a trigger would
-				 * cause this condition to run.  Since then, we have restructured how
-				 * trigger code is generated and so this condition is no longer
-				 * possible. However, it can still be true for statements like
-				 * the following:
-				 *
-				 *   CREATE TABLE t1(col INTEGER);
-				 *   SELECT (SELECT t1.col) FROM FROM t1;
-				 *
-				 * when columnType() is called on the expression "t1.col" in the
-				 * sub-select. In this case, set the column type to NULL, even
-				 * though it should really be "INTEGER".
-				 *
-				 * This is not a problem, as the column type of "t1.col" is never
-				 * used. When columnType() is called on the expression
-				 * "(SELECT t1.col)", the correct type is returned (see the TK_SELECT
-				 * branch below.
-				 */
-				break;
-			}
-
-			assert(pTab && pExpr->space_def == pTab->def);
-			if (pS) {
-				/* The "table" is actually a sub-select or a view in the FROM clause
-				 * of the SELECT statement. Return the declaration type and origin
-				 * data for the result-set column of the sub-select.
-				 */
-				assert(iCol >= 0);
-				if (ALWAYS(iCol < pS->pEList->nExpr)) {
-					/* The ALWAYS() is because
-					 * iCol>=pS->pEList->nExpr will have been
-					 * caught already by name resolution.
-					 */
-					NameContext sNC;
-					Expr *p = pS->pEList->a[iCol].pExpr;
-					sNC.pSrcList = pS->pSrc;
-					sNC.pNext = pNC;
-					sNC.pParse = pNC->pParse;
-					column_type =
-					    columnType(&sNC, p, &zOrigTab,
-						       &zOrigCol);
-				}
-			} else {
-				/* A real table */
-				assert(!pS);
-				assert(iCol >= 0 &&
-				       iCol < (int)pTab->def->field_count);
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-				zOrigCol = pTab->def->fields[iCol].name;
-				zType = pTab->def->fields[iCol].type;
-				zOrigTab = pTab->zName;
-#else
-				column_type = pTab->def->fields[iCol].type;
-#endif
-			}
-			break;
-		}
-	case TK_SELECT:{
-			/* The expression is a sub-select. Return the declaration type and
-			 * origin info for the single column in the result set of the SELECT
-			 * statement.
-			 */
-			NameContext sNC;
-			Select *pS = pExpr->x.pSelect;
-			Expr *p = pS->pEList->a[0].pExpr;
-			assert(ExprHasProperty(pExpr, EP_xIsSelect));
-			sNC.pSrcList = pS->pSrc;
-			sNC.pNext = pNC;
-			sNC.pParse = pNC->pParse;
-			column_type =
-			    columnType(&sNC, p, &zOrigTab, &zOrigCol);
-			break;
-		}
-	}
-
-#ifdef SQLITE_ENABLE_COLUMN_METADATA
-	if (pzOrigTab) {
-		assert(pzOrigTab && pzOrigCol);
-		*pzOrigTab = zOrigTab;
-		*pzOrigCol = zOrigCol;
-	}
-#endif
-	return column_type;
-}
-
 /*
  * Generate code that will tell the VDBE the names of columns
  * in the result set.  This information is used to provide the
@@ -2055,15 +1899,12 @@ sqlite3SelectAddColumnTypeAndCollation(Parse * pParse,		/* Parsing contexts */
 	sNC.pSrcList = pSelect->pSrc;
 	a = pSelect->pEList->a;
 	for (uint32_t i = 0; i < pTab->def->field_count; i++) {
-		enum field_type type;
 		p = a[i].pExpr;
-		type = columnType(&sNC, p, 0, 0);
-		pTab->def->fields[i].type = type;
-
 		char affinity = sqlite3ExprAffinity(p);
 		if (affinity == 0)
 			affinity = AFFINITY_BLOB;
 		pTab->def->fields[i].affinity = affinity;
+		pTab->def->fields[i].type = sql_affinity_to_field_type(affinity);
 		bool is_found;
 		uint32_t coll_id;
 		if (pTab->def->fields[i].coll_id == COLL_NONE &&
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index b2b22f914..82bc343e3 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -291,6 +291,8 @@ void sqlite3Coverage(int);
  */
 #define IS_BIG_INT(X)  (((X)&~(i64)0xffffffff)!=0)
 
+#define SQLITE_LIKE_DOESNT_MATCH_BLOBS
+
 #include "hash.h"
 #include "parse.h"
 #include <stdio.h>
@@ -1620,6 +1622,10 @@ struct sqlite3 {
 #define SQLITE_MAGIC_ERROR    0xb5357930	/* An SQLITE_MISUSE error occurred */
 #define SQLITE_MAGIC_ZOMBIE   0x64cffc7f	/* Close with last statement close */
 
+struct type_def {
+	enum affinity_type type;
+};
+
 /*
  * Each SQL function is defined by an instance of the following
  * structure.  For global built-in functions (ex: substr(), max(), count())
@@ -3323,7 +3329,7 @@ struct index *
 sql_table_primary_key(const struct Table *tab);
 
 void sqlite3StartTable(Parse *, Token *, int);
-void sqlite3AddColumn(Parse *, Token *, Token *);
+void sqlite3AddColumn(Parse *, Token *, struct type_def *);
 
 /**
  * This routine is called by the parser while in the middle of
@@ -3407,6 +3413,13 @@ sql_create_view(struct Parse *parse_context, struct Token *begin,
 		struct Token *name, struct ExprList *aliases,
 		struct Select *select, bool if_exists);
 
+/**
+ * Helper to convert SQLite affinity to corresponding
+ * Tarantool field type.
+ **/
+enum field_type
+sql_affinity_to_field_type(enum affinity_type affinity);
+
 /**
  * Compile view, i.e. create struct Select from
  * 'CREATE VIEW...' string, and assign cursors to each table from
@@ -4215,7 +4228,14 @@ sql_space_index_affinity_str(struct sqlite3 *db, struct space_def *space_def,
 void
 sql_emit_table_affinity(struct Vdbe *v, struct space_def *def, int reg);
 
-char sqlite3CompareAffinity(Expr * pExpr, char aff2);
+/**
+ * Return superposition of two affinities.
+ * This may be required for determining resulting
+ * affinity of expressions like a + '2'.
+ */
+enum affinity_type
+sql_affinity_result(enum affinity_type aff1, enum affinity_type aff2);
+
 int sqlite3IndexAffinityOk(Expr * pExpr, char idx_affinity);
 
 /**
@@ -4723,7 +4743,8 @@ void sqlite3EndBenignMalloc(void);
 #define IN_INDEX_NOOP_OK     0x0001	/* OK to return IN_INDEX_NOOP */
 #define IN_INDEX_MEMBERSHIP  0x0002	/* IN operator used for membership test */
 #define IN_INDEX_LOOP        0x0004	/* IN operator used as a loop */
-int sqlite3FindInIndex(Parse *, Expr *, u32, int *, int *, int *);
+int sqlite3FindInIndex(Parse *, Expr *, u32, int *, int *, int *,
+		       struct index_def **);
 
 void sqlite3ExprSetHeightAndFlags(Parse * pParse, Expr * p);
 #if SQLITE_MAX_EXPR_DEPTH>0
diff --git a/src/box/sql/tarantoolInt.h b/src/box/sql/tarantoolInt.h
index daab3c84b..c5730cb9d 100644
--- a/src/box/sql/tarantoolInt.h
+++ b/src/box/sql/tarantoolInt.h
@@ -217,9 +217,7 @@ fkey_encode_links(struct region *region, const struct fkey_def *def, int type,
  */
 char *
 sql_encode_index_parts(struct region *region, const struct field_def *fields,
-		       const struct index_def *idx_def,
-		       const struct index_def *pk_def,
-		       uint32_t *size);
+		       const struct index_def *idx_def, uint32_t *size);
 
 /**
  * Encode "opts" dictionary for _index entry on @region.
diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 7c1015cf9..49c1657b6 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -286,13 +286,13 @@ allocateCursor(
  * point or exponential notation, the result is only MEM_Real, even
  * if there is an exact integer representation of the quantity.
  */
-static void
+static int
 applyNumericAffinity(Mem *pRec, int bTryForInt)
 {
 	double rValue;
 	i64 iValue;
 	assert((pRec->flags & (MEM_Str|MEM_Int|MEM_Real))==MEM_Str);
-	if (sqlite3AtoF(pRec->z, &rValue, pRec->n)==0) return;
+	if (sqlite3AtoF(pRec->z, &rValue, pRec->n) == 0) return -1;
 	if (0 == sql_atoi64(pRec->z, (int64_t *)&iValue, pRec->n)) {
 		pRec->u.i = iValue;
 		pRec->flags |= MEM_Int;
@@ -301,6 +301,7 @@ applyNumericAffinity(Mem *pRec, int bTryForInt)
 		pRec->flags |= MEM_Real;
 		if (bTryForInt) sqlite3VdbeIntegerAffinity(pRec);
 	}
+	return 0;
 }
 
 /*
@@ -2110,7 +2111,14 @@ case OP_Ge: {             /* same as TK_GE, jump, in1, in3 */
 					flags3 = pIn3->flags;
 				}
 				if ((flags3 & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str) {
-					applyNumericAffinity(pIn3,0);
+					if (applyNumericAffinity(pIn3,0) != 0) {
+						sqlite3VdbeError(p,
+								 "Can't convert to numeric %s",
+								 sqlite3_value_text(pIn3));
+						rc = SQLITE_MISMATCH;
+						goto abort_due_to_error;
+					}
+
 				}
 			}
 			/* Handle the common case of integer comparison here, as an
diff --git a/src/box/sql/vdbemem.c b/src/box/sql/vdbemem.c
index e0b65fef5..072a05066 100644
--- a/src/box/sql/vdbemem.c
+++ b/src/box/sql/vdbemem.c
@@ -1257,7 +1257,7 @@ valueFromExpr(sqlite3 * db,	/* The database connection */
 	assert((pExpr->flags & EP_TokenOnly) == 0 || pCtx == 0);
 
 	if (op == TK_CAST) {
-		u8 aff = sqlite3AffinityType(pExpr->u.zToken, 0);
+		u8 aff = pExpr->affinity;
 		rc = valueFromExpr(db, pExpr->pLeft, aff, ppVal, pCtx);
 		testcase(rc != SQLITE_OK);
 		if (*ppVal) {
diff --git a/src/box/sql/where.c b/src/box/sql/where.c
index 713cabaff..8c78c0c9b 100644
--- a/src/box/sql/where.c
+++ b/src/box/sql/where.c
@@ -2254,7 +2254,8 @@ whereRangeVectorLen(Parse * pParse,	/* Parsing context */
 {
 	int nCmp = sqlite3ExprVectorSize(pTerm->pExpr->pLeft);
 	int i;
-
+	struct space *space = space_by_id(idx_def->space_id);
+	assert(space != NULL);
 	nCmp = MIN(nCmp, (int)(idx_def->key_def->part_count - nEq));
 	for (i = 1; i < nCmp; i++) {
 		/* Test if comparison i of pTerm is compatible with column (i+nEq)
@@ -2281,10 +2282,8 @@ whereRangeVectorLen(Parse * pParse,	/* Parsing context */
 		    pLhs->iColumn != (int)parts[i + nEq].fieldno ||
 		    parts[i + nEq].sort_order != parts[nEq].sort_order)
 			break;
-
-		struct space *space = space_by_id(idx_def->space_id);
-		assert(space != NULL);
-		aff = sqlite3CompareAffinity(pRhs, sqlite3ExprAffinity(pLhs));
+		enum affinity_type rhs_aff = sqlite3ExprAffinity(pRhs);
+		aff = sql_affinity_result(rhs_aff, sqlite3ExprAffinity(pLhs));
 		idxaff =
 		    sqlite3TableColumnAffinity(space->def, pLhs->iColumn);
 		if (aff != idxaff)
diff --git a/src/box/sql/wherecode.c b/src/box/sql/wherecode.c
index 8b161192e..0f26efe64 100644
--- a/src/box/sql/wherecode.c
+++ b/src/box/sql/wherecode.c
@@ -421,7 +421,8 @@ updateRangeAffinityStr(Expr * pRight,	/* RHS of comparison */
 	int i;
 	for (i = 0; i < n; i++) {
 		Expr *p = sqlite3VectorFieldSubexpr(pRight, i);
-		if (sqlite3CompareAffinity(p, zAff[i]) == AFFINITY_BLOB
+		enum affinity_type aff = sqlite3ExprAffinity(p);
+		if (sql_affinity_result(aff, zAff[i]) == AFFINITY_BLOB
 		    || sqlite3ExprNeedsNoAffinityChange(p, zAff[i])) {
 			zAff[i] = AFFINITY_BLOB;
 		}
@@ -497,7 +498,7 @@ codeEqualityTerm(Parse * pParse,	/* The parsing context */
 		    || pX->x.pSelect->pEList->nExpr == 1) {
 			eType =
 			    sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0,
-					       &iSingleIdxCol);
+					       &iSingleIdxCol, NULL);
 		} else {
 			Select *pSelect = pX->x.pSelect;
 			sqlite3 *db = pParse->db;
@@ -565,7 +566,7 @@ codeEqualityTerm(Parse * pParse,	/* The parsing context */
 				eType =
 				    sqlite3FindInIndex(pParse, pX,
 						       IN_INDEX_LOOP, 0, aiMap,
-						       0);
+						       0, NULL);
 				db->dbOptFlags = savedDbOptFlags;
 				testcase(aiMap != 0 && aiMap[0] != 0);
 				pSelect->pEList = pOrigRhs;
@@ -774,7 +775,9 @@ codeAllEqualityTerms(Parse * pParse,	/* Parsing context */
 				VdbeCoverage(v);
 			}
 			if (zAff) {
-				if (sqlite3CompareAffinity(pRight, zAff[j]) ==
+				enum affinity_type aff =
+					sqlite3ExprAffinity(pRight);
+				if (sql_affinity_result(aff, zAff[j]) ==
 				    AFFINITY_BLOB) {
 					zAff[j] = AFFINITY_BLOB;
 				}
diff --git a/test/box/sql-update-with-nested-select.result b/test/box/sql-update-with-nested-select.result
index 419cebb61..64a4fb656 100644
--- a/test/box/sql-update-with-nested-select.result
+++ b/test/box/sql-update-with-nested-select.result
@@ -3,7 +3,7 @@ test_run = require('test_run').new()
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE t1(a integer primary key, b UNIQUE, e);");
+box.sql.execute("CREATE TABLE t1(a integer primary key, b int UNIQUE, e int);");
 ---
 ...
 -- Debug
diff --git a/test/box/sql-update-with-nested-select.test.lua b/test/box/sql-update-with-nested-select.test.lua
index 7b90968ae..9421a3b52 100644
--- a/test/box/sql-update-with-nested-select.test.lua
+++ b/test/box/sql-update-with-nested-select.test.lua
@@ -3,7 +3,7 @@ test_run = require('test_run').new()
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE t1(a integer primary key, b UNIQUE, e);");
+box.sql.execute("CREATE TABLE t1(a integer primary key, b int UNIQUE, e int);");
 
 -- Debug
 -- box.sql.execute("PRAGMA vdbe_debug=ON ; INSERT INTO zoobar VALUES (111, 222, 'c3', 444)")
diff --git a/test/sql-tap/affinity2.test.lua b/test/sql-tap/affinity2.test.lua
deleted file mode 100755
index 16cd81432..000000000
--- a/test/sql-tap/affinity2.test.lua
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env tarantool
-test = require("sqltester")
-test:plan(10)
-
---!./tcltestrunner.lua
--- 2015-06-02
---
--- The author disclaims copyright to this source code.  In place of
--- a legal notice, here is a blessing:
---
---    May you do good and not evil.
---    May you find forgiveness for yourself and forgive others.
---    May you share freely, never taking more than you give.
---
--------------------------------------------------------------------------
--- This file implements regression tests for SQLite library.  The
--- focus of this file is type affinity in comparison operations.
---
--- EVERYWHERE HERE WAS 'ROWID' INSTEAD OF 'ID'
--- ["set","testdir",[["file","dirname",["argv0"]]]]
--- ["source",[["testdir"],"\/tester.tcl"]]
-test:do_execsql_test(
-    "affinity2-100",
-    [[
-        CREATE TABLE t1(
-          id integer primary key,
-          xi INTEGER,
-          xr REAL,
-          xb BLOB,
-          xn NUMERIC,
-          xt TEXT
-        );
-        INSERT INTO t1(id,xi,xr,xb,xn,xt) VALUES(1,1,1,1,1,1);
-        INSERT INTO t1(id,xi,xr,xb,xn,xt) VALUES(2,'2','2','2','2','2');
-        INSERT INTO t1(id,xi,xr,xb,xn,xt) VALUES(3,'03','03','03','03','03');
-
-    ]], {
-        -- <affinity2-100>
-        
-        -- </affinity2-100>
-    })
-
-test:do_execsql_test(
-    "affinity2-110",
-    [[
-        SELECT xi, typeof(xi) FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-110>
-        1, "integer", 2, "integer", 3, "integer"
-        -- </affinity2-110>
-    })
-
-test:do_execsql_test(
-    "affinity2-120",
-    [[
-        SELECT xr, typeof(xr) FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-120>
-        1.0, "real", 2.0, "real", 3.0, "real"
-        -- </affinity2-120>
-    })
-
-test:do_execsql_test(
-    "affinity2-130",
-    [[
-        SELECT xb, typeof(xb) FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-130>
-        1, "integer", "2", "text", "03", "text"
-        -- </affinity2-130>
-    })
-
-test:do_execsql_test(
-    "affinity2-140",
-    [[
-        SELECT xn, typeof(xn) FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-140>
-        1, "integer", 2, "integer", 3, "integer"
-        -- </affinity2-140>
-    })
-
-test:do_execsql_test(
-    "affinity2-150",
-    [[
-        SELECT xt, typeof(xt) FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-150>
-        "1", "text", "2", "text", "03", "text"
-        -- </affinity2-150>
-    })
-
-test:do_execsql_test(
-    "affinity2-200",
-    [[
-        SELECT id, xi==xt, xi==xb, xi==+xt FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-200>
-        1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1
-        -- </affinity2-200>
-    })
-
-test:do_execsql_test(
-    "affinity2-210",
-    [[
-        SELECT id, xr==xt, xr==xb, xr==+xt FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-210>
-        1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1
-        -- </affinity2-210>
-    })
-
-test:do_execsql_test(
-    "affinity2-220",
-    [[
-        SELECT id, xn==xt, xn==xb, xn==+xt FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-220>
-        1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1
-        -- </affinity2-220>
-    })
-
-test:do_execsql_test(
-    "affinity2-300",
-    [[
-        SELECT id, xt==+xi, xt==xi, xt==xb FROM t1 ORDER BY id;
-    ]], {
-        -- <affinity2-300>
-        1, 1, 1, 0, 2, 1, 1, 1, 3, 0, 1, 1
-        -- </affinity2-300>
-    })
-
-
-
-test:finish_test()
diff --git a/test/sql-tap/aggnested.test.lua b/test/sql-tap/aggnested.test.lua
index 627abdda5..08d4bce99 100755
--- a/test/sql-tap/aggnested.test.lua
+++ b/test/sql-tap/aggnested.test.lua
@@ -223,9 +223,9 @@ test:do_execsql_test("aggnested-3.3",
     [[
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t1(id1, value1 PRIMARY KEY);
+        CREATE TABLE t1(id1 INT, value1 INT PRIMARY KEY);
         INSERT INTO t1 VALUES(4469,2),(4469,1);
-        CREATE TABLE t2 (value2 PRIMARY KEY);
+        CREATE TABLE t2 (value2 INT PRIMARY KEY);
         INSERT INTO t2 VALUES(1);
         SELECT (SELECT sum(value2=value1) FROM t2), max(value1)
           FROM t1
diff --git a/test/sql-tap/alias.test.lua b/test/sql-tap/alias.test.lua
index df082b699..57e3335e9 100755
--- a/test/sql-tap/alias.test.lua
+++ b/test/sql-tap/alias.test.lua
@@ -38,7 +38,7 @@ test:do_test(
     "alias-1.1",
     function()
         return test:execsql([[
-            CREATE TABLE t1(x primary key);
+            CREATE TABLE t1(x INT primary key);
             INSERT INTO t1 VALUES(9);
             INSERT INTO t1 VALUES(8);
             INSERT INTO t1 VALUES(7);
diff --git a/test/sql-tap/alter.test.lua b/test/sql-tap/alter.test.lua
index 355c87a09..098b08fed 100755
--- a/test/sql-tap/alter.test.lua
+++ b/test/sql-tap/alter.test.lua
@@ -5,14 +5,14 @@ test:plan(41)
 test:do_execsql_test(
     "alter-1.1",
     [[
-        CREATE TABLE t1(id PRIMARY KEY, a, b);
+        CREATE TABLE t1(id  INT PRIMARY KEY, a INT , b INT );
         INSERT INTO t1 VALUES(1, 1, 2);
-        CREATE TABLE "t1x1"(c UNIQUE, b PRIMARY KEY);
+        CREATE TABLE "t1x1"(c  INT UNIQUE, b  INT PRIMARY KEY);
         INSERT INTO "t1x1" VALUES(3, 4);
         CREATE INDEX t1i1 ON T1(B);
         CREATE INDEX t1i2 ON t1(a, b);
         CREATE INDEX i3 ON "t1x1"(b, c);
-        CREATE TABLE "Space_Table"(id PRIMARY KEY, e, f, g UNIQUE);
+        CREATE TABLE "Space_Table"(id  INT PRIMARY KEY, e INT , f INT , g  INT UNIQUE);
         INSERT INTO "Space_Table" VALUES(1, 5, 6, 7);
         SELECT 't1', * FROM t1;
         SELECT 't1x1', * FROM "t1x1";
@@ -79,7 +79,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "alter-2.2",
     [[
-        CREATE TABLE t3(id PRIMARY KEY, p, q, r);
+        CREATE TABLE t3(id  INT PRIMARY KEY, p INT , q INT , r INT );
         ALTER TABLE t2 RENAME TO t3;
     ]], {
         -- <alter-2.2>
@@ -100,8 +100,8 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "alter-3.1",
     [[
-        CREATE TABLE t6(id PRIMARY KEY, a, b, c);
-        CREATE TABLE tab(id PRIMARY KEY);
+        CREATE TABLE t6(id  INT PRIMARY KEY, a INT , b INT , c INT );
+        CREATE TABLE tab(id  INT PRIMARY KEY);
         CREATE TRIGGER trig1 AFTER INSERT ON T6 BEGIN INSERT INTO tab VALUES(new.id); END;
         INSERT INTO t6 VALUES(1, 1, 2, 3);
         SELECT * FROM tab;
@@ -230,7 +230,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "alter-5.1",
     [[
-        CREATE TABLE xyz(x PRIMARY KEY);
+        CREATE TABLE xyz(x  INT PRIMARY KEY);
         ALTER TABLE xyz RENAME TO "xyz1234abc";
         SELECT "name" FROM "_space" WHERE "name" GLOB 'xyz*';
     ]], {
@@ -256,9 +256,9 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
         DROP TRIGGER trig3;
-        CREATE TABLE t1(id PRIMARY KEY, b, c);
+        CREATE TABLE t1(id  INT PRIMARY KEY, b INT , c INT );
         INSERT INTO t1 VALUES(1,2,3), (3,2,1);
-        CREATE TABLE t2(id PRIMARY KEY);
+        CREATE TABLE t2(id  INT PRIMARY KEY);
         CREATE TRIGGER on_t1 AFTER INSERT ON t1 BEGIN INSERT INTO t2 VALUES(new.id + 100); END;
         CREATE TRIGGER on_t2 AFTER INSERT ON t1 BEGIN INSERT INTO t2 VALUES(new.id + 101); END;
         CREATE TRIGGER on_t3 AFTER INSERT ON t1 BEGIN INSERT INTO t2 values(new.id + 102); END;
@@ -313,9 +313,9 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE t2(id PRIMARY KEY);
-        CREATE TABLE t3(id PRIMARY KEY);
-        CREATE TABLE t1(a PRIMARY KEY, b, c, FOREIGN KEY(b) REFERENCES t2(id), FOREIGN KEY(c) REFERENCES t3(id));
+        CREATE TABLE t2(id  INT PRIMARY KEY);
+        CREATE TABLE t3(id  INT PRIMARY KEY);
+        CREATE TABLE t1(a  INT PRIMARY KEY, b INT , c INT , FOREIGN KEY(b) REFERENCES t2(id), FOREIGN KEY(c) REFERENCES t3(id));
         INSERT INTO t2 VALUES(1);
         INSERT INTO t3 VALUES(2);
         INSERT INTO t1 VALUES(1, 1, 2);
diff --git a/test/sql-tap/alter2.test.lua b/test/sql-tap/alter2.test.lua
index 971be197d..d13cfb7a0 100755
--- a/test/sql-tap/alter2.test.lua
+++ b/test/sql-tap/alter2.test.lua
@@ -8,7 +8,7 @@ test:plan(21)
 test:do_catchsql_test(
     "alter2-1.1",
     [[
-        CREATE TABLE t1(id PRIMARY KEY, a, b);
+        CREATE TABLE t1(id INT PRIMARY KEY, a INT, b INT);
         ALTER TABLE t1 ADD CONSTRAINT fk1 FOREIGN KEY (a) REFERENCES t1(id);
         ALTER TABLE t1 ADD CONSTRAINT fk2 FOREIGN KEY (a) REFERENCES t1;
         INSERT INTO t1 VALUES(1, 1, 2);
@@ -136,8 +136,8 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "alter2-2.1",
     [[
-        CREATE TABLE child (id PRIMARY KEY, a, b);
-        CREATE TABLE parent (id PRIMARY KEY, c UNIQUE, d);
+        CREATE TABLE child (id INT PRIMARY KEY, a INT, b INT);
+        CREATE TABLE parent (id INT PRIMARY KEY, c INT UNIQUE, d INT);
         ALTER TABLE child ADD CONSTRAINT fk FOREIGN KEY (id) REFERENCES parent(c);
         ALTER TABLE parent ADD CONSTRAINT fk FOREIGN KEY (c) REFERENCES parent;
         INSERT INTO parent VALUES(1, 2, 3);
@@ -186,8 +186,8 @@ test:do_execsql_test(
     [[
         DROP TABLE child;
         DROP TABLE parent;
-        CREATE TABLE child (id PRIMARY KEY, a, b);
-        CREATE TABLE parent (id PRIMARY KEY, c, d);
+        CREATE TABLE child (id INT PRIMARY KEY, a INT, b INT);
+        CREATE TABLE parent (id INT PRIMARY KEY, c INT, d INT);
         ALTER TABLE child ADD CONSTRAINT fk FOREIGN KEY (id) REFERENCES parent ON DELETE CASCADE MATCH FULL;
         INSERT INTO parent VALUES(1, 2, 3), (3, 4, 5), (6, 7, 8);
         INSERT INTO child VALUES(1, 1, 1), (3, 2, 2);
@@ -204,8 +204,8 @@ test:do_execsql_test(
     [[
         DROP TABLE child;
         DROP TABLE parent;
-        CREATE TABLE child (id PRIMARY KEY, a, b);
-        CREATE TABLE parent (id PRIMARY KEY, c, d);
+        CREATE TABLE child (id INT PRIMARY KEY, a INT, b INT);
+        CREATE TABLE parent (id INT PRIMARY KEY, c INT, d INT);
         ALTER TABLE child ADD CONSTRAINT fk FOREIGN KEY (id) REFERENCES parent ON UPDATE CASCADE MATCH PARTIAL;
         INSERT INTO parent VALUES(1, 2, 3), (3, 4, 5), (6, 7, 8);
         INSERT INTO child VALUES(1, 1, 1), (3, 2, 2);
@@ -241,7 +241,7 @@ test:do_catchsql_test(
     "alter2-5.1",
     [[
         DROP TABLE child;
-        CREATE TABLE child (id PRIMARY KEY, a UNIQUE);
+        CREATE TABLE child (id INT PRIMARY KEY, a INT UNIQUE);
         ALTER TABLE child ADD CONSTRAINT fk FOREIGN KEY (id) REFERENCES child;
         ALTER TABLE child ADD CONSTRAINT fk FOREIGN KEY (a) REFERENCES child;
     ]], {
diff --git a/test/sql-tap/analyze1.test.lua b/test/sql-tap/analyze1.test.lua
index 2d8eed950..ea414e9a3 100755
--- a/test/sql-tap/analyze1.test.lua
+++ b/test/sql-tap/analyze1.test.lua
@@ -94,7 +94,7 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "analyze-1.10",
     [[
-        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b);
+        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT );
         ANALYZE t1;
     ]], {
         -- <analyze-1.10>
@@ -192,7 +192,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "analyze-3.4",
     [[
-        CREATE TABLE t2 (id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);
+        CREATE TABLE t2 (id INTEGER PRIMARY KEY AUTOINCREMENT, a INT , b INT );
         INSERT INTO t2 SELECT * FROM t1;
         CREATE INDEX t2i1 ON t2(a);
         CREATE INDEX t2i2 ON t2(b);
@@ -243,7 +243,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "analyze-3.8",
     [[
-        CREATE TABLE t3 (id INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c,d);
+        CREATE TABLE t3 (id INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT ,c INT ,d TEXT);
         INSERT INTO t3 (a,b,c,d) SELECT a, b, id AS c, 'hi' AS d FROM t1;
         CREATE INDEX t3i1 ON t3(a);
         CREATE INDEX t3i2 ON t3(a,b,c,d);
@@ -312,7 +312,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "analyze-4.0",
     [[
-        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, x,y,z);
+        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, x INT ,y INT ,z INT );
         CREATE INDEX t4i1 ON t4(x);
         CREATE INDEX t4i2 ON t4(y);
         INSERT INTO t4 SELECT id,a,b,c FROM t3;
@@ -356,7 +356,7 @@ test:do_execsql_test(
     [[
         DELETE FROM t3;
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(ud INTEGER PRIMARY KEY AUTOINCREMENT, x,y,z);
+        CREATE TABLE t4(ud INTEGER PRIMARY KEY AUTOINCREMENT, x INT ,y INT ,z INT );
         CREATE INDEX t4i1 ON t4(x);
         CREATE INDEX t4i2 ON t4(y);
         INSERT INTO t3 (a,b,c,d) VALUES(1,2,3,4);
@@ -494,7 +494,7 @@ test:do_test(
     "analyze-6.1.1",
     function()
         test:execsql("DROP TABLE IF EXISTS t1 ")
-        test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b, c, d, e);")
+        test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT, b TEXT, c TEXT, d INT, e INT);")
         test:execsql("CREATE INDEX i1 ON t1(a, b, c, d);")
         test:execsql("CREATE INDEX i2 ON t1(e);")
 
diff --git a/test/sql-tap/analyze3.test.lua b/test/sql-tap/analyze3.test.lua
index b879429d4..3a995393c 100755
--- a/test/sql-tap/analyze3.test.lua
+++ b/test/sql-tap/analyze3.test.lua
@@ -82,7 +82,7 @@ test:do_test(
     "analyze3-1.1.1",
     function()
         test:execsql([[
-            CREATE TABLE t1(id INT PRIMARY KEY, x INTEGER, y);
+            CREATE TABLE t1(id INT PRIMARY KEY, x INTEGER, y INT );
             CREATE INDEX i1 ON t1(x);
             START TRANSACTION;
         ]])
@@ -218,7 +218,7 @@ test:do_test(
 test:do_execsql_test(
     "analyze3-1.2.1",
     [[
-        CREATE TABLE t2(id INTEGER PRIMARY KEY, x TEXT, y);
+        CREATE TABLE t2(id INTEGER PRIMARY KEY, x TEXT, y INT);
         START TRANSACTION;
           INSERT INTO t2 SELECT * FROM t1;
         COMMIT;
@@ -236,7 +236,7 @@ test:do_execsql_test(
         SELECT count(*) FROM t2 WHERE x>1 AND x<2;
     ]], {
         -- <analyze3-2.1.x>
-        200
+        0
         -- </analyze3-2.1.x>
     })
 
@@ -246,17 +246,20 @@ test:do_execsql_test(
         SELECT count(*) FROM t2 WHERE x>0 AND x<99;
     ]], {
         -- <analyze3-2.1.x>
-        990
+        0
         -- </analyze3-2.1.x>
     })
 
+-- Types of column and search value don't match, so
+-- index search can't be used here.
+--
 test:do_eqp_test(
     "analyze3-1.2.2",
     [[
         SELECT sum(y) FROM t2 WHERE x>1 AND x<2
     ]], {
         -- <analyze3-1.2.2>
-        {0, 0, 0, "SEARCH TABLE T2 USING COVERING INDEX I2 (X>? AND X<?)"}
+        {0, 0, 0, "SCAN TABLE T2"}
         -- </analyze3-1.2.2>
     })
 
@@ -268,7 +271,7 @@ test:do_eqp_test(
     ]], {
         -- <analyze3-1.2.3>
         -- 0, 0, 0, "SCAN TABLE t2"
-        {0, 0, 0, "SEARCH TABLE T2 USING COVERING INDEX I2 (X>? AND X<?)"}
+        {0, 0, 0, "SCAN TABLE T2"}
         -- </analyze3-1.2.3>
     })
 
@@ -278,7 +281,7 @@ test:do_eqp_test(
         SELECT sum(y) FROM t2 WHERE x>12 AND x<20 
     ]], {
         -- <analyze3-1.2.4>
-        81, {4760}
+        999, {""}
         -- </analyze3-1.2.4>
     })
 
@@ -298,7 +301,7 @@ test:do_test(
         return test:sf_execsql("SELECT typeof(12), typeof(20), sum(y) FROM t2 WHERE x>12 AND x<20")
     end, {
         -- <analyze3-1.2.6>
-        81, {"integer", "integer", 4760}
+        999, {"integer", "integer", ""}
         -- </analyze3-1.2.6>
     })
 
@@ -308,7 +311,7 @@ test:do_sf_execsql_test(
         SELECT sum(y) FROM t2 WHERE x>0 AND x<99 
     ]], {
         -- <analyze3-1.2.7>
-        991, {490555}
+        999, {""}
         -- </analyze3-1.2.7>
     })
 
@@ -328,7 +331,7 @@ test:do_test(
         return test:sf_execsql("SELECT typeof(0), typeof(99), sum(y) FROM t2 WHERE x>0 AND x<99")
     end, {
         -- <analyze3-1.2.9>
-        991, {"integer", "integer", 490555}
+        999, {"integer", "integer", ""}
         -- </analyze3-1.2.9>
     })
 
@@ -339,7 +342,7 @@ test:do_test(
 test:do_execsql_test(
     "analyze3-1.3.1",
     [[
-        CREATE TABLE t3(id INTEGER PRIMARY KEY, y TEXT, x INTEGER);
+        CREATE TABLE t3(id INTEGER PRIMARY KEY, y INT, x INTEGER);
         START TRANSACTION;
           INSERT INTO t3 SELECT id, y, x FROM t1;
         COMMIT;
@@ -466,7 +469,7 @@ test:do_test(
 --         test:execsql([[
 --             PRAGMA case_sensitive_like=off;
 --             BEGIN;
---             CREATE TABLE t1(a, b TEXT COLLATE nocase);
+--             CREATE TABLE t1(a INT , b TEXT COLLATE nocase);
 --             CREATE INDEX i1 ON t1(b);
 --         ]])
 --         for _ in X(0, "X!for", [=[["set i 0","$i < 1000","incr i"]]=]) do
@@ -594,7 +597,7 @@ test:do_test(
     "analyze3-6.1",
     function()
         test:execsql(" DROP TABLE IF EXISTS t1 ")
-        test:execsql(" CREATE TABLE t1(id INTEGER PRIMARY KEY, a, b, c) ")
+        test:execsql(" CREATE TABLE t1(id INTEGER PRIMARY KEY, a REAL, b TEXT, c REAL) ")
         test:execsql("START TRANSACTION")
         for i=1,1000 do
             test:execsql(string.format("INSERT INTO t1 VALUES(%s, %s, 'x', %s)", i, ((i-1) / 100), ((i-1) / 10)))
@@ -641,7 +644,7 @@ test:do_execsql_test(
     "analyze-7.1",
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT , c INT );
         INSERT INTO t1 VALUES(1,1,'0000');
         CREATE INDEX t0b ON t1(b);
         ANALYZE;
diff --git a/test/sql-tap/analyze4.test.lua b/test/sql-tap/analyze4.test.lua
index c2cc190f1..f7344234c 100755
--- a/test/sql-tap/analyze4.test.lua
+++ b/test/sql-tap/analyze4.test.lua
@@ -28,7 +28,7 @@ test:do_test(
     "analyze4-1.0",
     function()
         test:execsql([[
-            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b);
+            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b TEXT);
             CREATE INDEX t1a ON t1(a);
             CREATE INDEX t1b ON t1(b);
             INSERT INTO t1 (a,b) VALUES(1,NULL);
@@ -94,7 +94,7 @@ test:do_execsql_test(
             --ALTER TABLE t1 ADD COLUMN d;
             -- So, re-create the table and its contents
             DROP TABLE t1;
-            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c DEFAULT NULL,d DEFAULT NULL);
+            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT ,c  INT DEFAULT NULL,d  INT DEFAULT NULL);
             CREATE INDEX t1a ON t1(a);
             CREATE INDEX t1b ON t1(b);
             INSERT INTO t1 (a,b) VALUES(1,NULL);
diff --git a/test/sql-tap/analyze5.test.lua b/test/sql-tap/analyze5.test.lua
index 67229e78f..69c4ba696 100755
--- a/test/sql-tap/analyze5.test.lua
+++ b/test/sql-tap/analyze5.test.lua
@@ -61,8 +61,8 @@ test:do_test(
     "analyze5-1.0",
     function()
         -- Tarantool: waiting for #2130
-        -- test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, t,u,v TEXT COLLATE nocase,w,x,y,z)")
-        test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, t,u,v,w,x,y,z)")
+        -- test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, t INT ,u INT ,v TEXT COLLATE nocase,w INT ,x INT ,y INT ,z INT )")
+        test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, t TEXT ,u TEXT ,v TEXT ,w TEXT ,x TEXT ,y TEXT ,z FLOAT)")
         for i=0,999 do -- _ in X(0, "X!for", [=[["set i 0","$i < 1000","incr i"]]=]) do
             if  ((i >= 25) and (i <= 50)) then
                 y = 1
@@ -253,9 +253,10 @@ for i, v in pairs({
         "analyze5-1."..i.."b",
         function()
             w2 = v[1]:gsub('y', '+y'):gsub('z', '+z')
+
             a1 = test:execsql("SELECT id FROM t1 NOT INDEXED WHERE "..w2.." ORDER BY +id")
             a2 = test:execsql("SELECT id FROM t1 WHERE "..v[1].." ORDER BY +id")
-            if (test:is_deeply_regex(a1, a2))
+            if (test.is_deeply_regex(a1, a2))
             then
                 res = "ok"
             else
diff --git a/test/sql-tap/analyze6.test.lua b/test/sql-tap/analyze6.test.lua
index 4bbb67c2a..04dadf25d 100755
--- a/test/sql-tap/analyze6.test.lua
+++ b/test/sql-tap/analyze6.test.lua
@@ -100,7 +100,7 @@ test:do_test(
     "analyze6-2.1",
     function()
         test:execsql([[
-            CREATE TABLE t201(x INTEGER PRIMARY KEY, y UNIQUE, z);
+            CREATE TABLE t201(x INTEGER PRIMARY KEY, y  INT UNIQUE, z INT );
             CREATE INDEX t201z ON t201(z);
             ANALYZE;
         ]])
diff --git a/test/sql-tap/analyze7.test.lua b/test/sql-tap/analyze7.test.lua
index 81e1eb410..cb7ab57bd 100755
--- a/test/sql-tap/analyze7.test.lua
+++ b/test/sql-tap/analyze7.test.lua
@@ -22,12 +22,12 @@ test:do_test(
 	function()
 		return test:execsql([[
 		    DROP TABLE IF EXISTS t1;
-			CREATE TABLE t1(id PRIMARY KEY, a, b, c, d);
+			CREATE TABLE t1(id  INT PRIMARY KEY, a INT , b INT , c INT , d INT );
 			CREATE INDEX t1a ON t1(a);
 			CREATE INDEX t1b ON t1(b);
 			CREATE INDEX t1cd ON t1(c, d);
 		    DROP TABLE IF EXISTS nums;
-			CREATE TABLE nums(n PRIMARY KEY);
+			CREATE TABLE nums(n  INT PRIMARY KEY);
 			INSERT into nums WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<256) SELECT x FROM cnt;
  			INSERT INTO t1 SELECT n, n, n, n/100, n FROM nums;
  			EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE a=123;
diff --git a/test/sql-tap/analyze8.test.lua b/test/sql-tap/analyze8.test.lua
index e06e3ed87..65052c747 100755
--- a/test/sql-tap/analyze8.test.lua
+++ b/test/sql-tap/analyze8.test.lua
@@ -33,7 +33,7 @@ test:do_test(
     1.0,
     function()
         test:execsql([[
-            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c,d);
+            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT ,c INT ,d INT );
             CREATE INDEX t1a ON t1(a);
             CREATE INDEX t1b ON t1(b);
             CREATE INDEX t1c ON t1(c);
diff --git a/test/sql-tap/analyze9.test.lua b/test/sql-tap/analyze9.test.lua
index 6b6251786..d884addce 100755
--- a/test/sql-tap/analyze9.test.lua
+++ b/test/sql-tap/analyze9.test.lua
@@ -96,15 +96,15 @@ test:do_execsql_test(
     2.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a PRIMARY KEY, b);
+        CREATE TABLE t1(a TEXT PRIMARY KEY, b INT );
         INSERT INTO t1 VALUES('some text', 14);
-        INSERT INTO t1 VALUES(22.0, 'some text');
+        INSERT INTO t1 VALUES('text', 12);
         CREATE INDEX i1 ON t1(a, b);
         ANALYZE;
         SELECT msgpack_decode_sample("sample") FROM "_sql_stat4";
     ]], {
         -- <2.1>
-        "some text 14", "22 some text", "some text", 22
+        "some text 14", "text 12", "some text", 22
         -- </2.1>
     })
 
@@ -113,7 +113,7 @@ test:do_execsql_test(
     3.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t2(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);
+        CREATE TABLE t2(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT , b INT );
         CREATE INDEX i2 ON t2(a, b);
     ]])
 
@@ -195,7 +195,7 @@ test:do_execsql_test(
     3.4,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT , c TEXT);
         INSERT INTO t1 VALUES(1, 1, 'one-a');
         INSERT INTO t1 VALUES(11, 1, 'one-b');
         INSERT INTO t1 VALUES(21, 1, 'one-c');
@@ -229,7 +229,7 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b, c);
+        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT , b INT , c INT);
         CREATE INDEX i1 ON t1(c, b, a);
     ]])
 
@@ -237,7 +237,7 @@ insert_filler_rows_n = function(iStart, nCopy, nVal)
     for i = 0, nVal-1 do
         local iVal = iStart+i
         for j = 0, nCopy-1 do
-            box.sql.execute(string.format("INSERT INTO t1 VALUES (null, %s, %s, %s)", iVal, iVal, iVal))
+            box.sql.execute(string.format("INSERT INTO t1 VALUES (null, %s, %s, '%s')", iVal, iVal, iVal))
         end
     end
 end
@@ -345,7 +345,7 @@ test:do_test(
     function()
         test:execsql([[
             DROP TABLE IF EXISTS t1;
-            CREATE TABLE t1(o,t INTEGER PRIMARY KEY);
+            CREATE TABLE t1(o TEXT,t INTEGER PRIMARY KEY);
             CREATE INDEX i1 ON t1(o);
         ]])
         for i = 0, 9999, 10 do
@@ -379,7 +379,7 @@ test:do_execsql_test(
     6.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);
+        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT , b INT );
         CREATE INDEX i1 ON t1(a);
         CREATE INDEX i2 ON t1(b);
         INSERT INTO t1 VALUES(null, 1, 1);
@@ -388,7 +388,7 @@ test:do_execsql_test(
         INSERT INTO t1 VALUES(null, 4, 4);
         INSERT INTO t1 VALUES(null, 5, 5);
         ANALYZE;
-        CREATE TABLE x1(tbl, idx, neq, nlt, ndlt, sample, PRIMARY KEY(tbl, idx, sample)); 
+        CREATE TABLE x1(tbl TEXT, idx TEXT , neq TEXT, nlt TEXT, ndlt TEXT, sample BLOB, PRIMARY KEY(tbl, idx, sample));
         INSERT INTO x1 SELECT * FROM "_sql_stat4";
         DELETE FROM "_sql_stat4";
         INSERT INTO "_sql_stat4" SELECT * FROM x1;
@@ -409,7 +409,7 @@ test:do_execsql_test(
     7.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);
+        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT , b INT );
         CREATE INDEX i1 ON t1(a, b);
         INSERT INTO t1 VALUES(null, 1, 1);
         INSERT INTO t1 VALUES(null, 2, 2);
@@ -480,7 +480,7 @@ test:do_execsql_test(
     8.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(id PRIMARY KEY, x TEXT);
+        CREATE TABLE t1(id  INT PRIMARY KEY, x TEXT);
         CREATE INDEX i1 ON t1(x);
         INSERT INTO t1 VALUES(1, '1');
         INSERT INTO t1 VALUES(2, '2');
@@ -507,7 +507,7 @@ test:do_execsql_test(
 --     9.1,
 --     [[
 --         DROP TABLE IF EXISTS t1;
---         CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b, c, d, e);
+--         CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT , b INT , c INT , d INT , e INT );
 --         CREATE INDEX i1 ON t1(a, b, c, d);
 --         CREATE INDEX i2 ON t1(e);
 --     ]])
@@ -578,7 +578,7 @@ test:do_execsql_test(
     "10.1.1",
     [[
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE t3(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);
+        CREATE TABLE t3(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT , b INT );
         CREATE INDEX t3a ON t3(a);
         CREATE INDEX t3b ON t3(b);
     ]])
@@ -626,7 +626,7 @@ test:do_execsql_test(
     "10.2.1",
     [[
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE t3(id INTEGER PRIMARY KEY AUTOINCREMENT, x, a, b);
+        CREATE TABLE t3(id INTEGER PRIMARY KEY AUTOINCREMENT, x TEXT, a INT , b INT);
         CREATE INDEX t3a ON t3(x, a);
         CREATE INDEX t3b ON t3(x, b);
     ]])
@@ -677,7 +677,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "11.0",
     [[
-        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, a COLLATE "unicode_ci", b);
+        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT COLLATE "unicode_ci", b INT);
         CREATE INDEX t4b ON t4(b);
         CREATE INDEX t4a ON t4(a);
     ]], {
@@ -707,7 +707,7 @@ test:do_test(
 test:do_execsql_test(
     "11.2", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a = 'def' AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a = '"def"' AND b = 3;
     ]], {
         -- <11.2>
         0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (B=?)"
@@ -717,10 +717,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "11.3", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a = 'abc' AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a = '"abc"' AND b = 3;
     ]], {
         -- <11.3>
-        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (B=?)"
+        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4A (A=?)"
         -- </11.3>
     })
 
@@ -728,7 +728,7 @@ test:do_execsql_test(
     "11.4",
     [[
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);
+        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT , b INT);
         CREATE INDEX t4b ON t4(b);
         CREATE INDEX t4a ON t4(a COLLATE "unicode_ci");
     ]], {
@@ -758,7 +758,7 @@ test:do_test(
 test:do_execsql_test(
     "11.6", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a = 'def' AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a = '"def"' AND b = 3;
     ]], {
         -- <11.6>
         0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (B=?)"
@@ -768,20 +768,20 @@ test:do_execsql_test(
 test:do_execsql_test(
     "11.7", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a = 'abc' COLLATE "unicode_ci" AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a = '"abc"' COLLATE "unicode_ci" AND b = 3;
     ]], {
         -- <11.7>
-        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (B=?)"
+        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4A (A=?)"
         -- </11.7>
     })
 
 test:do_execsql_test(
     "11.8", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a COLLATE "unicode_ci" = 'abc' AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE a COLLATE "unicode_ci" = '"abc"' AND b = 3;
     ]], {
         -- <11.8>
-        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (B=?)"
+        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4A (A=?)"
         -- </11.8>
     })
 
@@ -789,7 +789,7 @@ test:do_execsql_test(
     "12.0",
     [[
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, x, a COLLATE "unicode_ci", b);
+        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, x TEXT , a TEXT COLLATE "unicode_ci", b INT);
         CREATE INDEX t4b ON t4(x, b);
         CREATE INDEX t4a ON t4(x, a);
     ]], {
@@ -819,7 +819,7 @@ test:do_test(
 test:do_execsql_test(
     "12.2", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE x = 'abcdef' AND a = 'def' AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE x = 'abcdef' AND a = '"def"' AND b = 3;
     ]], {
         -- <12.2>
         0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (X=? AND B=?)"
@@ -829,10 +829,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "12.3", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE x = 'abcdef' AND a = 'abc' AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE x = 'abcdef' AND a = '"abc"' AND b = 3;
     ]], {
         -- <12.3>
-        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (X=? AND B=?)"
+        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4A (X=? AND A=?)"
         -- </12.3>
     })
 
@@ -840,7 +840,7 @@ test:do_execsql_test(
     "12.4",
     [[
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, x, a, b);
+        CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, x TEXT, a TEXT, b INT);
         CREATE INDEX t4b ON t4(x, b);
         CREATE INDEX t4a ON t4(x, a COLLATE "unicode_ci");
     ]], {
@@ -880,20 +880,20 @@ test:do_execsql_test(
 test:do_execsql_test(
     "12.7", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE x= 'abcdef' AND a = 'abc' COLLATE "unicode_ci" AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE x= 'abcdef' AND a = '"abc"' COLLATE "unicode_ci" AND b = 3;
     ]], {
         -- <12.7>
-        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (X=? AND B=?)"
+        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4A (X=? AND A=?)"
         -- </12.7>
     })
 
 test:do_execsql_test(
     "12.8", 
     [[
-        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE x = 'abcdef' AND a COLLATE "unicode_ci" = 'abc' AND b = 3;
+        EXPLAIN QUERY PLAN SELECT * FROM t4 WHERE x = 'abcdef' AND a COLLATE "unicode_ci" = '"abc"' AND b = 3;
     ]], {
         -- <12.8>
-        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4B (X=? AND B=?)"
+        0, 0, 0, "SEARCH TABLE T4 USING COVERING INDEX T4A (X=? AND A=?)"
         -- </12.8>
     })
 
@@ -905,7 +905,7 @@ test:do_test(
     13.1,
     function()
         test:execsql("DROP TABLE IF EXISTS t1;")
-        test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b, c, d);")
+        test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT, b INT, c INT, d INT);")
         test:execsql("CREATE INDEX i1 ON t1(a);")
         test:execsql("CREATE INDEX i2 ON t1(b, c);")
         local a = 0
@@ -972,7 +972,7 @@ test:do_test(
     14.1,
     function()
         test:execsql("DROP TABLE IF EXISTS t1")
-        test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b INTEGER, c)")
+        test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT, b INTEGER, c INT)")
         for i = 0, 100 do
             local c = i % 3
             test:execsql(string.format(" INSERT INTO t1 VALUES(null, 'ott', %s, %s) ", i, c))
@@ -1016,7 +1016,7 @@ test:do_execsql_test(
     15.1,
     [[
         DROP TABLE IF EXISTS x1;
-        CREATE TABLE x1(a PRIMARY KEY, b, UNIQUE(a, b));
+        CREATE TABLE x1(a  INT PRIMARY KEY, b INT , UNIQUE(a, b));
         INSERT INTO x1 VALUES(1, 2);
         INSERT INTO x1 VALUES(3, 4);
         INSERT INTO x1 VALUES(5, 6);
@@ -1037,7 +1037,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     15.3,
     [[
-        INSERT INTO "_sql_stat4" VALUES('42', '42', '42', '42', '42', 42);
+        INSERT INTO "_sql_stat4" VALUES('42', '42', '42', '42', '42', '42');
     ]])
 
 test:do_execsql_test(
@@ -1111,7 +1111,7 @@ test:do_test(
     function()
         test:execsql([[
             DROP TABLE IF EXISTS t1;
-            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b, c, d);
+            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT, b INT, c INT, d TEXT);
             CREATE INDEX i1 ON t1(a, b);
             INSERT INTO t1 VALUES(null, -1, -1, -1, NULL);
             INSERT INTO t1 SELECT null, 2*a,2*b,2*c,d FROM t1;
@@ -1190,7 +1190,7 @@ test:do_test(
     function()
         test:execsql([[
             DROP TABLE IF EXISTS t1;
-            CREATE TABLE t1(a PRIMARY KEY, b);
+            CREATE TABLE t1(a  INT PRIMARY KEY, b INT );
             CREATE INDEX i1 ON t1(a, b);
         ]])
         for i = 0, 8 do
@@ -1219,7 +1219,7 @@ test:do_test(
             DROP TABLE IF EXISTS t1;
             DROP TABLE IF EXISTS x1;
             DROP TABLE IF EXISTS t3;
-            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c,d);
+            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT ,c INT ,d INT );
             CREATE INDEX i1 ON t1(a,b,c,d);
         ]])
         for i = 0, 23 do
@@ -1256,7 +1256,7 @@ test:do_execsql_test(
     21.0,
     [[
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t2(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);
+        CREATE TABLE t2(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT, b INT );
         CREATE INDEX i2 ON t2(a);
     ]])
 
@@ -1300,7 +1300,7 @@ test:do_execsql_test(
     22.0,
     [[
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE t3(a, b, c, d, PRIMARY KEY(a, b));
+        CREATE TABLE t3(a TEXT , b INT , c TEXT , d INT , PRIMARY KEY(a, b));
     ]])
 
 test:do_execsql_test(
@@ -1389,7 +1389,7 @@ box.internal.sql_create_function("int_to_char", "TEXT", int_to_char)
 test:do_execsql_test(
     24.0,
     [[
-        CREATE TABLE t5(c, d, b, e, a, PRIMARY KEY(a, b, c));
+        CREATE TABLE t5(c INT , d INT , b TEXT, e INT , a TEXT, PRIMARY KEY(a, b, c));
         WITH data(a, b, c, d, e) AS (SELECT 'z', 'y', 0, 0, 0 UNION ALL 
             SELECT a, CASE WHEN b='y' THEN 'n' ELSE 'y' END, c+1, e/250, e+1 FROM data WHERE e<1000) 
                 INSERT INTO t5(a, b, c, d, e) SELECT * FROM data;
@@ -1442,7 +1442,7 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t6;
         DROP TABLE IF EXISTS ints;
-        CREATE TABLE t6(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b);
+        CREATE TABLE t6(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT , b INT );
         WITH ints(i,j) AS (SELECT 1,1 UNION ALL SELECT i+1,j+1 FROM ints WHERE i<100) 
             INSERT INTO t6 SELECT null,* FROM ints;
         CREATE INDEX aa ON t6(a);
@@ -1514,7 +1514,7 @@ test:do_test(
     function()
         test:execsql([[
             DROP TABLE IF EXISTS t1;
-            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, x, y, z);
+            CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, x INT , y INT , z INT );
             CREATE INDEX t1xy ON t1(x, y);
             CREATE INDEX t1z ON t1(z);
         ]])
@@ -1598,7 +1598,7 @@ test:do_execsql_test(
     "26.2.1",
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, x, y, z);
+        CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, x TEXT, y INT , z INT );
         CREATE INDEX i1 ON t1(x, y);
         CREATE INDEX i2 ON t1(z);
 
diff --git a/test/sql-tap/analyzeC.test.lua b/test/sql-tap/analyzeC.test.lua
index a3cea7056..266e37eff 100755
--- a/test/sql-tap/analyzeC.test.lua
+++ b/test/sql-tap/analyzeC.test.lua
@@ -34,7 +34,7 @@ test:do_execsql_test(
     1.0,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a PRIMARY KEY, b, c, d);
+        CREATE TABLE t1(a  INT PRIMARY KEY, b INT , c INT , d INT );
         INSERT INTO t1(a,b,c,d) VALUES(1,1,2,3),(2,7,8,9),(3,4,5,6),(4,10,11,12),(5,4,8,12),(6,1,11,111);
         CREATE INDEX t1b ON t1(b);
         CREATE INDEX t1c ON t1(c);
diff --git a/test/sql-tap/analyzeD.test.lua b/test/sql-tap/analyzeD.test.lua
index ef6aced18..4bce88bff 100755
--- a/test/sql-tap/analyzeD.test.lua
+++ b/test/sql-tap/analyzeD.test.lua
@@ -32,7 +32,7 @@ testprefix = "analyzeD"
 test:do_execsql_test(
     1.0,
     [[
-        CREATE TABLE t1(id PRIMARY KEY, a, b, c);
+        CREATE TABLE t1(id  INT PRIMARY KEY, a INT , b INT , c INT );
     ]])
 
 
@@ -41,7 +41,7 @@ test:do_test(
 	function()
 		for i = 1, 999 do
 			local c = math.floor(i % 200);
-			test:execsql(string.format(" INSERT INTO t1(id, a, b, c) VALUES(%s, 2*(%s/100), %s%%10, %s ); ", i, i, i, c))
+			test:execsql(string.format(" INSERT INTO t1(id, a, b, c) VALUES(%s, 2*(%s + 100), %s%%10, %s ); ", i, i, i, c))
 		end
 	return test:execsql([[
 			INSERT INTO t1 VALUES(1001, 3001, 3001, 3001);
diff --git a/test/sql-tap/analyzeE.test.lua b/test/sql-tap/analyzeE.test.lua
index 6e0aa03f0..c0a33ad86 100755
--- a/test/sql-tap/analyzeE.test.lua
+++ b/test/sql-tap/analyzeE.test.lua
@@ -26,7 +26,7 @@ test:do_execsql_test(
     "analyzeE-1.0",
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(id INTEGER PRIMARY KEY, a, b);
+        CREATE TABLE t1(id INTEGER PRIMARY KEY, a INT , b INT );
         WITH RECURSIVE cnt(x) AS (VALUES(1000) UNION ALL SELECT x+1 FROM cnt WHERE x<2000) INSERT INTO t1(id, a, b) SELECT x, x, x FROM cnt;
         CREATE INDEX t1a ON t1(a);
         CREATE INDEX t1b ON t1(b);
@@ -277,7 +277,7 @@ test:do_execsql_test(
     "analyzeE-3.0",
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(id PRIMARY KEY,a,b,c);
+        CREATE TABLE t1(id  INT PRIMARY KEY,a INT ,b INT ,c INT );
         WITH RECURSIVE cnt(x) AS (VALUES(1000) UNION ALL SELECT x+1 FROM cnt WHERE x<2000) INSERT INTO t1(id,a,b,c) SELECT x, x, x, 123 FROM cnt;
         CREATE INDEX t1ca ON t1(c,a);
         ANALYZE;
diff --git a/test/sql-tap/analyzeF.test.lua b/test/sql-tap/analyzeF.test.lua
index c5e11c84e..40185db09 100755
--- a/test/sql-tap/analyzeF.test.lua
+++ b/test/sql-tap/analyzeF.test.lua
@@ -28,7 +28,7 @@ test:do_execsql_test(
     1.0,
     [[
     	DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(id PRIMARY KEY, x INTEGER, y INTEGER);
+        CREATE TABLE t1(id  INT PRIMARY KEY, x INTEGER, y INTEGER);
         WITH data(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM data) INSERT INTO t1 SELECT i, isqrt(i), isqrt(i) FROM data LIMIT 500;
         CREATE INDEX t1y ON t1(y);
         CREATE INDEX t1x ON t1(x);
diff --git a/test/sql-tap/autoinc.test.lua b/test/sql-tap/autoinc.test.lua
index dda70611f..e7b3b2186 100755
--- a/test/sql-tap/autoinc.test.lua
+++ b/test/sql-tap/autoinc.test.lua
@@ -30,7 +30,7 @@ test:plan(46)
 test:do_execsql_test(
     "autoinc-1.2",
     [[
-        CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y);
+        CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y INT );
     ]], {
         -- <autoinc-1.2>
 
@@ -269,7 +269,7 @@ test:do_test(
             DROP TABLE t2;
         ]])
         return test:execsql([[
-            CREATE TABLE t2(d, e INTEGER PRIMARY KEY AUTOINCREMENT, f);
+            CREATE TABLE t2(d INT , e INTEGER PRIMARY KEY AUTOINCREMENT, f INT );
             INSERT INTO t2(d) VALUES(1);
         ]])
     end, {
@@ -302,7 +302,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "autoinc-2.73",
     [[
-        CREATE TABLE t3(g INTEGER PRIMARY KEY AUTOINCREMENT, h);
+        CREATE TABLE t3(g INTEGER PRIMARY KEY AUTOINCREMENT, h INT );
         INSERT INTO t3(h) VALUES(1);
         SELECT max(x) FROM t1 UNION SELECT max(e) FROM t2
           UNION SELECT max(g) FROM t3;
@@ -388,7 +388,7 @@ test:do_execsql_test(
 -- test:do_execsql_test(
 --     "autoinc-4.2",
 --     [[
---         CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y);
+--         CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y INT );
 --         CREATE TEMP TABLE t3(a INTEGER PRIMARY KEY AUTOINCREMENT, b);
 --         SELECT 1, name FROM sqlite_master WHERE type='table';
 --         SELECT 2, name FROM sqlite_temp_master WHERE type='table';
@@ -516,7 +516,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "autoinc-6.1",
     [[
-        CREATE TABLE t6(v INTEGER PRIMARY KEY AUTOINCREMENT, w);
+        CREATE TABLE t6(v INTEGER PRIMARY KEY AUTOINCREMENT, w INT );
         INSERT INTO t6 VALUES(9223372036854775807,1);
         SELECT max(v) FROM t6;
     ]], {
@@ -574,9 +574,9 @@ test:do_test(
     "autoinc-9.1",
     function()
         return test:execsql([[
-            CREATE TABLE t2(x INTEGER PRIMARY KEY AUTOINCREMENT, y);
+            CREATE TABLE t2(x INTEGER PRIMARY KEY AUTOINCREMENT, y INT );
             INSERT INTO t2 VALUES(NULL, 1);
-            CREATE TABLE t3(a INTEGER PRIMARY KEY AUTOINCREMENT, b);
+            CREATE TABLE t3(a INTEGER PRIMARY KEY AUTOINCREMENT, b INT );
             INSERT INTO t3 SELECT * FROM t2 WHERE y>1;
 
             SELECT max(a) FROM t3;
@@ -648,7 +648,7 @@ test:do_test(
     "autoinc-3928.1",
     function()
         return test:execsql([[
-            CREATE TABLE t3928(a INTEGER PRIMARY KEY AUTOINCREMENT, b);
+            CREATE TABLE t3928(a INTEGER PRIMARY KEY AUTOINCREMENT, b TEXT);
             CREATE TRIGGER t3928r1 BEFORE INSERT ON t3928 BEGIN
               INSERT INTO t3928(b) VALUES('before1');
               INSERT INTO t3928(b) VALUES('before2');
@@ -685,11 +685,11 @@ test:do_test(
             DROP TRIGGER t3928r1;
             DROP TRIGGER t3928r2;
             CREATE TRIGGER t3928r3 BEFORE UPDATE ON t3928
-              WHEN typeof(new.b)=='integer' BEGIN
+              WHEN new.b=='456' BEGIN
                  INSERT INTO t3928(b) VALUES('before-int-' || new.b);
             END;
             CREATE TRIGGER t3928r4 AFTER UPDATE ON t3928
-              WHEN typeof(new.b)=='integer' BEGIN
+              WHEN new.b=='456' BEGIN
                  INSERT INTO t3928(b) VALUES('after-int-' || new.b);
             END;
             DELETE FROM t3928 WHERE a!=1;
@@ -698,7 +698,7 @@ test:do_test(
         ]])
     end, {
         -- <autoinc-3928.3>
-        1, 456, 14, "before-int-456", 15, "after-int-456"
+        1, '456', 14, "before-int-456", 15, "after-int-456"
         -- </autoinc-3928.3>
     })
 
@@ -723,7 +723,7 @@ test:do_test(
             INSERT INTO t3928b VALUES(200);
             INSERT INTO t3928b VALUES(300);
             DELETE FROM t3928;
-            CREATE TABLE t3928c(y INTEGER PRIMARY KEY AUTOINCREMENT, z);
+            CREATE TABLE t3928c(y INTEGER PRIMARY KEY AUTOINCREMENT, z TEXT);
             CREATE TRIGGER t3928br1 BEFORE DELETE ON t3928b BEGIN
               INSERT INTO t3928(b) VALUES('before-del-'||old.x);
               INSERT INTO t3928c(z) VALUES('before-del-'||old.x);
@@ -770,7 +770,7 @@ test:do_test(
     "autoinc-a69637.1",
     function()
         return test:execsql([[
-            CREATE TABLE ta69637_1(x INTEGER PRIMARY KEY AUTOINCREMENT, y);
+            CREATE TABLE ta69637_1(x INTEGER PRIMARY KEY AUTOINCREMENT, y INT );
             CREATE TABLE ta69637_2(z INTEGER PRIMARY KEY);
             CREATE TRIGGER ra69637_1 AFTER INSERT ON ta69637_2 BEGIN
               INSERT INTO ta69637_1(y) VALUES(new.z+1);
diff --git a/test/sql-tap/autoindex4.test.lua b/test/sql-tap/autoindex4.test.lua
index a567c5e7d..a2c018a7d 100755
--- a/test/sql-tap/autoindex4.test.lua
+++ b/test/sql-tap/autoindex4.test.lua
@@ -23,9 +23,9 @@ test:plan(7)
 test:do_execsql_test(
     "autoindex4-1.0",
     [[
-        CREATE TABLE t1(a,b, primary key(a,b));
+        CREATE TABLE t1(a INT,b TEXT, primary key(a,b));
         INSERT INTO t1 VALUES(123,'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
-        CREATE TABLE t2(x,y, primary key(x,y));
+        CREATE TABLE t2(x INT,y TEXT, primary key(x,y));
         INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
 
         SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=987 ORDER BY +b;
@@ -76,7 +76,7 @@ test:do_execsql_test(
     })
 
 -- do_execsql_test autoindex4-2.0 {
---   CREATE TABLE t3(e,f);
+--   CREATE TABLE t3(e INT,f INT);
 --   INSERT INTO t3 VALUES(123,654),(555,444),(234,987);
 --   SELECT (SELECT count(*) FROM t1, t2 WHERE a=e AND x=f), e, f, '|'
 --     FROM t3
diff --git a/test/sql-tap/boundary1.test.lua b/test/sql-tap/boundary1.test.lua
index 6beab9a5e..e35e1edbd 100755
--- a/test/sql-tap/boundary1.test.lua
+++ b/test/sql-tap/boundary1.test.lua
@@ -26,7 +26,7 @@ test:do_test(
     "boundary1-1.1",
     function()
         return test:execsql([[
-            CREATE TABLE t1(rowid primary key, a,x);
+            CREATE TABLE t1(rowid  INT primary key, a INT ,x BLOB);
             INSERT INTO t1(rowid,a,x) VALUES(-8388609,1,'ffffffffff7fffff');
             INSERT INTO t1(rowid,a,x) VALUES(-36028797018963969,2,'ff7fffffffffffff');
             INSERT INTO t1(rowid,a,x) VALUES(9223372036854775807,3,'7fffffffffffffff');
diff --git a/test/sql-tap/boundary3.test.lua b/test/sql-tap/boundary3.test.lua
index 5b63e0539..c5d605b65 100755
--- a/test/sql-tap/boundary3.test.lua
+++ b/test/sql-tap/boundary3.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(1896)
+test:plan(1894)
 
 --!./tcltestrunner.lua
 -- 2008 December 11
@@ -26,10 +26,10 @@ test:do_test(
     "boundary3-1.1",
     function()
         return test:execsql([[
-            CREATE TABLE t1(rowid primary key, a,x);
+            CREATE TABLE t1(rowid  INT primary key, a FLOAT ,x BLOB);
             INSERT INTO t1(rowid,a,x) VALUES(-8388609,1,'ffffffffff7fffff');
             INSERT INTO t1(rowid,a,x) VALUES(-36028797018963969,2,'ff7fffffffffffff');
-            INSERT INTO t1(rowid,a,x) VALUES(9223372036854775807,3,'7fffffffffffffff');
+            INSERT INTO t1(rowid,a,x) VALUES(9223372036854775806,3,'7fffffffffffffff');
             INSERT INTO t1(rowid,a,x) VALUES(127,4,'000000000000007f');
             INSERT INTO t1(rowid,a,x) VALUES(3,5,'0000000000000003');
             INSERT INTO t1(rowid,a,x) VALUES(16777216,6,'0000000001000000');
@@ -81,7 +81,7 @@ test:do_test(
             INSERT INTO t1(rowid,a,x) VALUES(-3,52,'fffffffffffffffd');
             INSERT INTO t1(rowid,a,x) VALUES(-128,53,'ffffffffffffff80');
             INSERT INTO t1(rowid,a,x) VALUES(-129,54,'ffffffffffffff7f');
-            INSERT INTO t1(rowid,a,x) VALUES(-9223372036854775808,55,'8000000000000000');
+            INSERT INTO t1(rowid,a,x) VALUES(-9223372036854775807,55,'8000000000000000');
             INSERT INTO t1(rowid,a,x) VALUES(4398046511104,56,'0000040000000000');
             INSERT INTO t1(rowid,a,x) VALUES(1099511627775,57,'000000ffffffffff');
             INSERT INTO t1(rowid,a,x) VALUES(-549755813889,58,'ffffff7fffffffff');
@@ -109,14 +109,14 @@ test:do_test(
     "boundary3-1.3",
     function()
         return test:execsql([[
-            CREATE TABLE t2(r primary key,a);
+            CREATE TABLE t2(r INT primary key, a REAL);
             INSERT INTO t2 SELECT rowid, a FROM t1;
             CREATE INDEX t2i1 ON t2(r);
             CREATE INDEX t2i2 ON t2(a);
             ---INSERT INTO t2 VALUES(100000,9.22337303685477580800e+18,65);
             ---INSERT INTO t2 VALUES(100001,-9.22337303685477580800e+18,66);
-            INSERT INTO t2 VALUES(9.22337303685477580800e+18,65);
-            INSERT INTO t2 VALUES(-9.22337303685477580800e+18,66);
+            INSERT INTO t2 VALUES(9223372036854775807, 65);
+            INSERT INTO t2 VALUES(-9223372036854775808, 66);
             SELECT count(*) FROM t2;
         ]])
     end, {
@@ -125,7 +125,7 @@ test:do_test(
         -- </boundary3-1.3>
     })
 
-test:do_execsql_test(
+--[[test:do_execsql_test(
     "boundary3-2.1.1",
     "SELECT t1.a, t1.x FROM  t1, t2 WHERE t1.rowid=72057594037927935 AND t2.a=t1.a"
     ,{17, "00ffffffffffffff"})
@@ -134,7 +134,7 @@ test:do_execsql_test(
     "boundary3-2.1.2",
     "SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='00ffffffffffffff'"
     ,{72057594037927935LL, 17})
-
+]]
 test:do_execsql_test(
     "boundary3-2.1.3",
     "SELECT t1.rowid, t1.x FROM  t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=17"
@@ -2318,12 +2318,12 @@ test:do_execsql_test(
 test:do_execsql_test(
     "boundary3-2.16.ge.1",
     "SELECT t2.a FROM t1 JOIN t2 USING(a) WHERE t1.rowid >= 9223372036854775807 ORDER BY t2.a"
-    ,{3})
+    ,{})
 
 test:do_execsql_test(
     "boundary3-2.16.ge.2",
     "SELECT t2.a FROM t2 NATURAL JOIN t1 WHERE t1.rowid >= 9223372036854775807 ORDER BY t1.a DESC"
-    ,{3})
+    ,{})
 
 test:do_execsql_test(
     "boundary3-2.16.ge.3",
@@ -2343,12 +2343,12 @@ test:do_execsql_test(
 test:do_execsql_test(
     "boundary3-2.16.lt.1",
     "SELECT t2.a FROM t1 JOIN t2 USING(a) WHERE t1.rowid < 9223372036854775807 ORDER BY t2.a"
-    ,{1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64})
+    ,{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64})
 
 test:do_execsql_test(
     "boundary3-2.16.lt.2",
     "SELECT t2.a FROM t2 NATURAL JOIN t1 WHERE t1.rowid < 9223372036854775807 ORDER BY t1.a DESC"
-    ,{64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 2, 1})
+    ,{64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1})
 
 test:do_execsql_test(
     "boundary3-2.16.lt.3",
@@ -6768,27 +6768,27 @@ test:do_execsql_test(
 test:do_execsql_test(
     "boundary3-2.46.1",
     "SELECT t1.a, t1.x FROM  t1, t2 WHERE t1.rowid=-9223372036854775808 AND t2.a=t1.a"
-    ,{55, "8000000000000000"})
+    ,{})
 
 test:do_execsql_test(
     "boundary3-2.46.2",
     "SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='8000000000000000'"
-    ,{-9223372036854775808LL, 55})
+    ,{-9223372036854775807LL,55})
 
 test:do_execsql_test(
     "boundary3-2.46.3",
     "SELECT t1.rowid, t1.x FROM  t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=55"
-    ,{-9223372036854775808LL, "8000000000000000"})
+    ,{-9223372036854775807LL, "8000000000000000"})
 
 test:do_execsql_test(
     "boundary3-2.46.gt.1",
     "SELECT t2.a FROM t1 JOIN t2 USING(a) WHERE t1.rowid > -9223372036854775808 ORDER BY t2.a"
-    ,{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64})
+    ,{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64})
 
 test:do_execsql_test(
     "boundary3-2.46.gt.2",
     "SELECT t2.a FROM t2 NATURAL JOIN t1 WHERE t1.rowid > -9223372036854775808 ORDER BY t1.a DESC"
-    ,{64, 63, 62, 61, 60, 59, 58, 57, 56, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1})
+    ,{64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1})
 
 test:do_execsql_test(
     "boundary3-2.46.gt.3",
@@ -6858,12 +6858,12 @@ test:do_execsql_test(
 test:do_execsql_test(
     "boundary3-2.46.le.1",
     "SELECT t2.a FROM t1 JOIN t2 USING(a) WHERE t1.rowid <= -9223372036854775808 ORDER BY t2.a"
-    ,{55})
+    ,{})
 
 test:do_execsql_test(
     "boundary3-2.46.le.2",
     "SELECT t2.a FROM t2 NATURAL JOIN t1 WHERE t1.rowid <= -9223372036854775808 ORDER BY t1.a DESC"
-    ,{55})
+    ,{})
 
 test:do_execsql_test(
     "boundary3-2.46.le.3",
diff --git a/test/sql-tap/cast.test.lua b/test/sql-tap/cast.test.lua
index 29110dc45..e3b7b1248 100755
--- a/test/sql-tap/cast.test.lua
+++ b/test/sql-tap/cast.test.lua
@@ -80,7 +80,7 @@ test:do_execsql_test(
         SELECT typeof(CAST(x'616263' AS numeric))
     ]], {
         -- <cast-1.6>
-        "integer"
+        "real"
         -- </cast-1.6>
     })
 
@@ -282,7 +282,7 @@ test:do_execsql_test(
         SELECT typeof(CAST(123 AS numeric))
     ]], {
         -- <cast-1.26>
-        "integer"
+        "real"
         -- </cast-1.26>
     })
 
@@ -482,7 +482,7 @@ test:do_execsql_test(
         SELECT typeof(CAST('123abc' AS numeric))
     ]], {
         -- <cast-1.46>
-        "integer"
+        "real"
         -- </cast-1.46>
     })
 
@@ -689,7 +689,7 @@ test:do_execsql_test(
         SELECT CAST(9223372036854774800 AS numeric)
     ]], {
         -- <cast-3.2>
-        9223372036854774800LL
+        9223372036854774784
         -- </cast-3.2>
     })
 
@@ -724,7 +724,7 @@ test:do_execsql_test(
         SELECT CAST(-9223372036854774800 AS numeric)
     ]], {
         -- <cast-3.6>
-        -9223372036854774800LL
+        -9223372036854774784
         -- </cast-3.6>
     })
 
@@ -759,7 +759,7 @@ test:do_execsql_test(
         SELECT CAST('9223372036854774800' AS numeric)
     ]], {
         -- <cast-3.12>
-        9223372036854774800LL
+        9223372036854774784
         -- </cast-3.12>
     })
 
@@ -796,7 +796,7 @@ test:do_execsql_test(
         SELECT CAST('-9223372036854774800' AS numeric)
     ]], {
         -- <cast-3.16>
-        -9223372036854774800LL
+        -9223372036854774784
         -- </cast-3.16>
     })
 
@@ -834,7 +834,7 @@ if true then --test:execsql("PRAGMA encoding")[1][1]=="UTF-8" then
             SELECT CAST(x'39323233333732303336383534373734383030' AS numeric)
         ]], {
             -- <cast-3.22>
-            9223372036854774800LL
+            9223372036854774784
             -- </cast-3.22>
         })
     test:do_execsql_test(
@@ -906,7 +906,7 @@ test:do_test(
     "cast-4.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a primary key);
+            CREATE TABLE t1(a TEXT primary key);
             INSERT INTO t1 VALUES('abc');
             SELECT a, CAST(a AS integer) FROM t1;
         ]]
diff --git a/test/sql-tap/check.test.lua b/test/sql-tap/check.test.lua
index 3a33a6329..039e2291e 100755
--- a/test/sql-tap/check.test.lua
+++ b/test/sql-tap/check.test.lua
@@ -30,7 +30,7 @@ test:do_execsql_test(
         CREATE TABLE t1(
           x INTEGER CHECK( x<5 ),
           y REAL CHECK( y>x ),
-          z primary key
+          z  INT primary key
         );
     ]], {
         -- <check-1.1>
@@ -205,7 +205,7 @@ test:do_execsql_test(
     "check-2.1",
     [[
         CREATE TABLE t2(
-          id primary key,
+          id  INT primary key,
           x INTEGER CONSTRAINT one CHECK( typeof(coalesce(x,0))=='integer'),
           y REAL CONSTRAINT two CHECK( typeof(coalesce(y,0.1))=='real' ),
           z TEXT CONSTRAINT three CHECK( typeof(coalesce(z,''))=='text' )
@@ -340,7 +340,7 @@ test:do_catchsql_test(
     "check-3.1",
     [[
         CREATE TABLE t3(
-          x primary key, y, z,
+          x  INT primary key, y INT , z INT ,
           CHECK( x<(SELECT min(x) FROM t1) )
         );
     ]], {
@@ -365,7 +365,7 @@ test:do_catchsql_test(
     "check-3.3",
     [[
         CREATE TABLE t3(
-          x primary key, y, z,
+          x  INT primary key, y INT , z INT ,
           CHECK( q<x )
         );
     ]], {
@@ -389,7 +389,7 @@ test:do_catchsql_test(
     "check-3.5",
     [[
         CREATE TABLE t3(
-          x primary key, y, z,
+          x  INT primary key, y INT , z INT ,
           CHECK( t2.x<x )
         );
     ]], {
@@ -413,7 +413,7 @@ test:do_catchsql_test(
     "check-3.7",
     [[
         CREATE TABLE t3(
-          x primary key, y, z,
+          x  INT primary key, y INT , z INT ,
           CHECK( t3.x<25 )
         );
     ]], {
@@ -446,7 +446,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "check-4.1",
     [[
-        CREATE TABLE t4(x primary key, y,
+        CREATE TABLE t4(x  INT primary key, y INT ,
           CHECK (
                x+y==11
             OR x*y==12
@@ -537,7 +537,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "check-5.1",
     [[
-        CREATE TABLE t5(x primary key, y,
+        CREATE TABLE t5(x  INT primary key, y INT ,
           CHECK( x*y<:abc )
         );
     ]], {
@@ -549,7 +549,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "check-5.2",
     [[
-        CREATE TABLE t5(x primary key, y,
+        CREATE TABLE t5(x  INT primary key, y INT ,
           CHECK( x*y<? )
         );
     ]], {
@@ -713,7 +713,7 @@ box.internal.sql_create_function("myfunc", "INT", myfunc)
 test:do_execsql_test(
     7.1,
     [[
-        CREATE TABLE t6(a CHECK (myfunc(a)) primary key)
+        CREATE TABLE t6(a  INT CHECK (myfunc(a)) primary key)
     ]])
 
 test:do_execsql_test(
@@ -756,7 +756,7 @@ test:do_test(
 test:do_test(
     7.6,
     function()
-        return test:catchsql(" CREATE TABLE t7(a CHECK (myfunc(a))) ") --, "db2")
+        return test:catchsql(" CREATE TABLE t7(a  INT CHECK (myfunc(a))) ") --, "db2 INT ")
     end, {
         -- <7.6>
         1, "no such function: MYFUNC"
@@ -791,7 +791,7 @@ end
 test:do_execsql_test(
     8.1,
     [[
-        CREATE TABLE t810(a primary key, CHECK( t810.a>0 ));
+        CREATE TABLE t810(a  INT primary key, CHECK( t810.a>0 ));
     ]], {
         -- <8.1>
 
diff --git a/test/sql-tap/coalesce.test.lua b/test/sql-tap/coalesce.test.lua
index ef177c925..5740c1b37 100755
--- a/test/sql-tap/coalesce.test.lua
+++ b/test/sql-tap/coalesce.test.lua
@@ -21,7 +21,7 @@ test:do_test(
     "coalesce-1.0",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, d);
+            CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT, c INT, d INT);
             INSERT INTO t1 VALUES(1, null, null, null);
             INSERT INTO t1 VALUES(2, 2, 99, 99);
             INSERT INTO t1 VALUES(3, null, 3, 99);
diff --git a/test/sql-tap/collation.test.lua b/test/sql-tap/collation.test.lua
index 4d33d0c9d..eb4f43a90 100755
--- a/test/sql-tap/collation.test.lua
+++ b/test/sql-tap/collation.test.lua
@@ -167,7 +167,7 @@ for _, data_collation in ipairs(data_collations) do
         local result = test_case[3]
         test:do_execsql_test(
             extendex_prefix.."create_table",
-            string.format("create table t1(a primary key, b %s);", data_collation[1]),
+            string.format("create table t1(a INT primary key, b TEXT %s);", data_collation[1]),
             {})
         test:do_test(
             extendex_prefix.."insert_values",
diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
index ddc06eea7..207e7a979 100755
--- a/test/sql-tap/colname.test.lua
+++ b/test/sql-tap/colname.test.lua
@@ -72,11 +72,11 @@ test:do_test(
     "colname-2.1",
     function()
         test:execsql [[
-            CREATE TABLE tabc(a PRIMARY KEY,b,c);
+            CREATE TABLE tabc(a INT PRIMARY KEY,b INT,c INT);
             INSERT INTO tabc VALUES(1,2,3);
-            CREATE TABLE txyz(x PRIMARY KEY,y,z);
+            CREATE TABLE txyz(x INT PRIMARY KEY,y INT,z INT);
             INSERT INTO txyz VALUES(4,5,6);
-            CREATE TABLE tboth(a PRIMARY KEY,b,c,x,y,z);
+            CREATE TABLE tboth(a INT PRIMARY KEY,b INT,c INT,x INT,y INT,z INT);
             INSERT INTO tboth VALUES(11,12,13,14,15,16);
             CREATE VIEW v1 AS SELECT tabC.a, txyZ.x, * 
               FROM tabc, txyz ORDER BY 1 LIMIT 1;
@@ -442,7 +442,7 @@ test:do_execsql2_test(
 --            return lreplace( test:execsql("SELECT x.* FROM sqlite_master X LIMIT 1;"), 3, 3,"x")
 --        end, {
 --            -- <colname-5.1>
---            "table", "tabc", "tabc", "x", "CREATE TABLE tabc(a,b,c)"
+--            "table", "tabc", "tabc", "x", "CREATE TABLE tabc(a INT,b INT,c INT)"
 --            -- </colname-5.1>
 --        })
 
@@ -460,7 +460,7 @@ test:do_test(
             PRAGMA full_column_names='OFF';
             ]])
         test:execsql [=[
-            CREATE TABLE t6(a primary key, "'a'", """a""", "[a]", "`a`");
+            CREATE TABLE t6(a INT primary key, "'a'" INT, """a""" INT, "[a]" INT,  "`a`" INT);
             INSERT INTO t6 VALUES(1,2,3,4,5);
         ]=]
         return test:execsql2 "SELECT * FROM t6"
@@ -537,7 +537,7 @@ test:do_test(
     "colname-7.1",
     function()
         test:execsql [[
-            CREATE TABLE t7(x INTEGER PRIMARY KEY, y);
+            CREATE TABLE t7(x INTEGER PRIMARY KEY, y INT);
             INSERT INTO t7 VALUES(1,2);
         ]]
         return test:execsql2 "SELECT x, * FROM t7"
@@ -553,7 +553,7 @@ test:do_test(
     "colname-8.1",
     function()
         return test:execsql [[
-            CREATE TABLE t3893("x" PRIMARY KEY);
+            CREATE TABLE t3893("x" INT PRIMARY KEY);
             INSERT INTO t3893 VALUES(123);
             SELECT "y"."x" FROM (SELECT "x" FROM t3893) AS "y";
         ]]
@@ -597,7 +597,7 @@ for i, val in ipairs(data2) do
     )
 end
 
-test:execsql([[ create table table1("a" primary key, "b") ]])
+test:execsql([[ create table table1("a" TEXT primary key, "b" TEXT) ]])
 test:execsql("insert into table1 values('a1', 'a1')")
 
 -- " is used for identifiers
@@ -636,16 +636,16 @@ test:do_test(
 
 test:do_catchsql_test(
     "colname-11.1",
-    [[ create table t1(a, b, c, primary key('A'))]],
+    [[ create table t1(a INT, b INT, c INT, primary key('A'))]],
     {1, "expressions prohibited in PRIMARY KEY"})
 
 test:do_catchsql_test(
     "colname-11.2",
-    [[CREATE TABLE t1(a, b, c, d, e, 
+    [[CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT,
       PRIMARY KEY(a), UNIQUE('b' COLLATE "unicode_ci" DESC));]],
     {1, "/Tarantool does not support functional indexes/"})
 
-test:execsql("create table table1(a primary key, b, c)")
+test:execsql("create table table1(a  INT primary key, b INT, c INT)")
 
 test:do_catchsql_test(
     "colname-11.3",
diff --git a/test/sql-tap/count.test.lua b/test/sql-tap/count.test.lua
index 45808de8d..b05e3a28e 100755
--- a/test/sql-tap/count.test.lua
+++ b/test/sql-tap/count.test.lua
@@ -45,7 +45,7 @@ for _, zIndex in ipairs(queries) do
         function()
             test:execsql [[
                 DROP TABLE IF EXISTS t1;
-                CREATE TABLE t1(a, b, PRIMARY KEY(a,b));
+                CREATE TABLE t1(a INT , b INT , PRIMARY KEY(a,b));
             ]]
             test:execsql(zIndex)
             return test:execsql(" SELECT count(*) FROM t1 ")
@@ -117,7 +117,7 @@ test:do_test(
     "count-2.1",
     function()
         test:execsql [[
-            CREATE TABLE t2(a, b, PRIMARY KEY(a,b));
+            CREATE TABLE t2(a INT , b INT , PRIMARY KEY(a,b));
         ]]
         return uses_op_count("SELECT count(*) FROM t2")
     end,1)
@@ -217,7 +217,7 @@ test:do_test(
 test:do_execsql_test(
     "count-3.1",
     [[
-        CREATE TABLE t3(a, b, PRIMARY KEY(a,b));
+        CREATE TABLE t3(a INT , b INT , PRIMARY KEY(a,b));
         SELECT a FROM (SELECT count(*) AS a FROM t3) WHERE a==0;
     ]], {
         -- <count-3.1>
@@ -238,7 +238,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "count-4.1",
     [[
-        CREATE TABLE t4(a PRIMARY KEY, b);
+        CREATE TABLE t4(a TEXT PRIMARY KEY, b TEXT );
         INSERT INTO t4 VALUES('a', 'b');
         CREATE INDEX t4i1 ON t4(b, a);
         SELECT count(*) FROM t4;
@@ -286,7 +286,7 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "count-6.1",
     [[
-        CREATE TABLE t6(x PRIMARY KEY);
+        CREATE TABLE t6(x  INT PRIMARY KEY);
         SELECT count(DISTINCT) FROM t6 GROUP BY x;
     ]], {
         -- <count-6.1>
diff --git a/test/sql-tap/cse.test.lua b/test/sql-tap/cse.test.lua
index 3544ef66e..4b25f936d 100755
--- a/test/sql-tap/cse.test.lua
+++ b/test/sql-tap/cse.test.lua
@@ -26,7 +26,7 @@ test:do_test(
     "cse-1.1",
     function()
         test:execsql [[
-            CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, d, e, f);
+            CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT , c INT , d INT , e INT , f INT );
             INSERT INTO t1 VALUES(1,11,12,13,14,15);
             INSERT INTO t1 VALUES(2,21,22,23,24,25);
         ]]
@@ -221,11 +221,11 @@ test:do_execsql_test(
 test:do_execsql_test(
     "cse-2.1",
     [[
-        CREATE TABLE t2(a0 PRIMARY KEY,a1,a2,a3,a4,a5,a6,a7,a8,a9,
-                        a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,
-                        a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,
-                        a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,
-                        a40,a41,a42,a43,a44,a45,a46,a47,a48,a49);
+        CREATE TABLE t2(a0  INT PRIMARY KEY,a1 INT ,a2 INT ,a3 INT ,a4 INT ,a5 INT ,a6 INT ,a7 INT ,a8 INT ,a9 INT ,
+                        a10 INT ,a11 INT ,a12 INT ,a13 INT ,a14 INT ,a15 INT ,a16 INT ,a17 INT ,a18 INT ,a19 INT ,
+                        a20 INT ,a21 INT ,a22 INT ,a23 INT ,a24 INT ,a25 INT ,a26 INT ,a27 INT ,a28 INT ,a29 INT ,
+                        a30 INT ,a31 INT ,a32 INT ,a33 INT ,a34 INT ,a35 INT ,a36 INT ,a37 INT ,a38 INT ,a39 INT ,
+                        a40 INT ,a41 INT ,a42 INT ,a43 INT ,a44 INT ,a45 INT ,a46 INT ,a47 INT ,a48 INT ,a49 INT );
         INSERT INTO t2 VALUES(0,1,2,3,4,5,6,7,8,9,
                         10,11,12,13,14,15,16,17,18,19,
                         20,21,22,23,24,25,26,27,28,29,
diff --git a/test/sql-tap/date.test.lua b/test/sql-tap/date.test.lua
index 624437641..acddfe090 100755
--- a/test/sql-tap/date.test.lua
+++ b/test/sql-tap/date.test.lua
@@ -418,7 +418,7 @@ datetest(13.34, "date('2001-01-01','-1.5 years')", "1999-07-02")
 -- if {0==[sqlite3 -has-codec]} {
 --   do_test date-14.1 {
 --     execsql {
---       CREATE TABLE t1(x);
+--       CREATE TABLE t1(x FLOAT );
 --       INSERT INTO t1 VALUES(1.1);
 --     }
 --     db close
diff --git a/test/sql-tap/default.test.lua b/test/sql-tap/default.test.lua
index 88bfa219f..40e60d017 100755
--- a/test/sql-tap/default.test.lua
+++ b/test/sql-tap/default.test.lua
@@ -75,12 +75,12 @@ test:do_execsql_test(
 	[[
 	CREATE TABLE t4(
 	rowid INTEGER PRIMARY KEY AUTOINCREMENT, 
-	c DEFAULT 'abc'
+	c TEXT DEFAULT 'abc'
 	);
 	PRAGMA table_info(t4);
 	]], {
 	-- <default-2.1>
-	0,"ROWID","integer",1,"",1,1,"C","scalar",0,"'abc'",0
+	0,"ROWID","integer",1,"",1,1,"C","string",0,"'abc'",0
 	-- </default-2.1>
 })
 
@@ -91,7 +91,7 @@ test:do_execsql_test(
 	PRAGMA table_info(t4);
 	]], {
 	-- <default-2.2>
-	0,"ROWID","integer",1,"",1,1,"C","scalar",0,"'abc'",0
+	0,"ROWID","integer",1,"",1,1,"C","string",0,"'abc'",0
 	-- </default-2.2>
 })
 
@@ -103,13 +103,13 @@ test:do_execsql_test(
 	CREATE TABLE t3(
 	a INTEGER PRIMARY KEY AUTOINCREMENT,
 	b INT DEFAULT 12345 UNIQUE NOT NULL CHECK( b>=0 AND b<99999 ),
-	c VARCHAR(123,456) DEFAULT 'hello' NOT NULL,
+	c VARCHAR(123) DEFAULT 'hello' NOT NULL,
 	d REAL,
-	e FLOATING POINT(5,10) DEFAULT 4.36,
-	f NATIONAL CHARACTER(15), --COLLATE RTRIM,
-	g LONG INTEGER DEFAULT( 3600*12 )
+	e NUMERIC(5,10) DEFAULT 4.36,
+	f VARCHAR(15), --COLLATE RTRIM,
+	g INTEGER DEFAULT( 3600*12 )
 	);
-	INSERT INTO t3 VALUES(null, 5, 'row1', '5.25', 'xyz', 321, '432');
+	INSERT INTO t3 VALUES(null, 5, 'row1', 5.25, 8.67, 321, 432);
 	SELECT a, typeof(a), b, typeof(b), c, typeof(c), 
 	d, typeof(d), e, typeof(e), f, typeof(f),
 	g, typeof(g) FROM t3;
@@ -119,7 +119,7 @@ test:do_execsql_test(
 	-- In current situation I don't know what to do, need Kirill's
 	-- advice.
 	-- Bulat
-	1, "integer", 5, "integer", "row1", "text", 5.25, "real", "xyz", "text", "321", "text", 432, "integer"
+	1, "integer", 5, "integer", "row1", "text", 5.25, "real", 8.67, "real", "321", "text", 432, "integer"
 	-- </default-3.1>
 })
 
@@ -135,26 +135,26 @@ test:do_execsql_test(
 	-- </default-3.2>
 })
 
-test:do_execsql_test(
-	"default-3.3",
-	[[
-	CREATE TABLE t300(
-	pk INTEGER PRIMARY KEY AUTOINCREMENT,
-	a INT DEFAULT 2147483647,
-	b INT DEFAULT 2147483648,
-	c INT DEFAULT +9223372036854775807,
-	d INT DEFAULT -2147483647,
-	e INT DEFAULT -2147483648,
-	f INT DEFAULT (-9223372036854775808),
-	h INT DEFAULT (-(-9223372036854775807))
-	);
-	INSERT INTO t300 DEFAULT VALUES;
-	SELECT a, b, c, d, e, f, h FROM t300;
-	]], {
-	-- <default-3.3>
-	2147483647, 2147483648, 9223372036854775807LL, -2147483647, -2147483648, -9223372036854775808LL, 9223372036854775807LL
-	-- </default-3.3>
-})
+--test:do_execsql_test(
+--	"default-3.3",
+--	[[
+--	CREATE TABLE t300(
+--	pk INTEGER PRIMARY KEY AUTOINCREMENT,
+--	a INT DEFAULT 2147483647,
+--	b INT DEFAULT 2147483648,
+--	c INT DEFAULT +9223372036854775807,
+--	d INT DEFAULT -2147483647,
+--	e INT DEFAULT -2147483648,
+--	f INT DEFAULT (-9223372036854775808),
+--	h INT DEFAULT (-(-9223372036854775807))
+--	);
+--	INSERT INTO t300 DEFAULT VALUES;
+--	SELECT a, b, c, d, e, f, h FROM t300;
+--	]], {
+--	-- <default-3.3>
+--	2147483647, 2147483648, 9223372036854775807LL, -2147483647, -2147483648, -9223372036854775808LL, 9223372036854775807LL
+--	-- </default-3.3>
+--})
 
 -- Do now allow bound parameters in new DEFAULT values. 
 -- Silently convert bound parameters to NULL in DEFAULT causes
diff --git a/test/sql-tap/delete4.test.lua b/test/sql-tap/delete4.test.lua
index bf96accb7..074c5ee88 100755
--- a/test/sql-tap/delete4.test.lua
+++ b/test/sql-tap/delete4.test.lua
@@ -22,7 +22,7 @@ testprefix = "delete4"
 test:do_execsql_test(
     1.1,
     [[
-        CREATE TABLE t1(x INTEGER PRIMARY KEY, y);
+        CREATE TABLE t1(x INTEGER PRIMARY KEY, y INT );
         INSERT INTO t1 VALUES(1, 0);
         INSERT INTO t1 VALUES(2, 1);
         INSERT INTO t1 VALUES(3, 0);
@@ -56,7 +56,7 @@ test:do_execsql_test(
     2.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
+        CREATE TABLE t1(x INTEGER PRIMARY KEY, y INT , z BLOB);
         INSERT INTO t1 VALUES(1, 0, randomblob(200));
         INSERT INTO t1 VALUES(2, 1, randomblob(200));
         INSERT INTO t1 VALUES(3, 0, randomblob(200));
@@ -90,7 +90,7 @@ test:do_execsql_test(
     3.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a, b, PRIMARY KEY(a, b));
+        CREATE TABLE t1(a INT , b INT , PRIMARY KEY(a, b));
         INSERT INTO t1 VALUES(1, 2);
         INSERT INTO t1 VALUES(2, 4);
         INSERT INTO t1 VALUES(1, 5);
@@ -110,7 +110,7 @@ test:do_execsql_test(
     3.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(i INTEGER PRIMARY KEY, a, b);
+        CREATE TABLE t1(i INTEGER PRIMARY KEY, a TEXT, b TEXT);
         CREATE INDEX i1a ON t1(a);
         CREATE INDEX i1b ON t1(b);
         INSERT INTO t1 VALUES(1, 'one', 'i');
@@ -154,7 +154,7 @@ test:do_execsql_test(
     4.1,
     [[
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(col0 PRIMARY KEY, col1);
+        CREATE TABLE t4(col0  INT PRIMARY KEY, col1 TEXT);
         INSERT INTO t4 VALUES(14, 'abcde');
         CREATE INDEX idx_t4_0 ON t4 (col1, col0);
         DELETE FROM t4 WHERE col0=69 OR col0>7;
@@ -168,7 +168,7 @@ test:do_execsql_test(
     4.2,
     [[
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(col0 PRIMARY KEY, col1);
+        CREATE TABLE t4(col0  INT PRIMARY KEY, col1 TEXT);
         INSERT INTO t4 VALUES(14, 'abcde');
         CREATE INDEX idx_t4_0 ON t4 (col1, col0);
         DELETE FROM t4 WHERE col0=69 OR col0>7;
@@ -182,7 +182,7 @@ test:do_execsql_test(
     4.11,
     [[
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(col0, col1, pk PRIMARY KEY);
+        CREATE TABLE t4(col0 INT , col1 TEXT, pk TEXT PRIMARY KEY);
         INSERT INTO t4 VALUES(14, 'abcde','xyzzy');
         CREATE INDEX idx_t4_0 ON t4 (col1, col0);
         CREATE INDEX idx_t4_3 ON t4 (col0);
@@ -197,7 +197,7 @@ test:do_execsql_test(
     4.12,
     [[
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(col0, col1, pk PRIMARY KEY);
+        CREATE TABLE t4(col0 INT , col1 TEXT, pk TEXT PRIMARY KEY);
         INSERT INTO t4 VALUES(14, 'abcde','xyzzy');
         CREATE INDEX idx_t4_3 ON t4 (col0);
         CREATE INDEX idx_t4_0 ON t4 (col1, col0);
diff --git a/test/sql-tap/distinct.test.lua b/test/sql-tap/distinct.test.lua
index ff0d4d029..26a4aace2 100755
--- a/test/sql-tap/distinct.test.lua
+++ b/test/sql-tap/distinct.test.lua
@@ -92,15 +92,15 @@ end
 test:do_execsql_test(
     1.0,
     [[
-        CREATE TABLE t1(id INTEGER PRIMARY KEY, a, b, c, d);
+        CREATE TABLE t1(id INTEGER PRIMARY KEY, a TEXT , b TEXT , c TEXT , d TEXT );
         CREATE UNIQUE INDEX i2 ON t1(d COLLATE "unicode_ci");
 
-        CREATE TABLE t2(x INTEGER PRIMARY KEY, y);
+        CREATE TABLE t2(x INTEGER PRIMARY KEY, y INT );
 
-        CREATE TABLE t3(c1 PRIMARY KEY NOT NULL, c2 NOT NULL);
+        CREATE TABLE t3(c1  INT PRIMARY KEY NOT NULL, c2  INT NOT NULL);
         CREATE INDEX i3 ON t3(c2);
 
-        CREATE TABLE t4(id INTEGER PRIMARY KEY, a, b NOT NULL, c NOT NULL, d NOT NULL);
+        CREATE TABLE t4(id INTEGER PRIMARY KEY, a INT , b  INT NOT NULL, c  INT NOT NULL, d TEXT NOT NULL);
         CREATE UNIQUE INDEX t4i1 ON t4(b, c);
         CREATE UNIQUE INDEX t4i2 ON t4(d COLLATE "unicode_ci");
     ]])
@@ -157,7 +157,7 @@ test:execsql([[
 test:do_execsql_test(
     2.0,
     [[
-        CREATE TABLE t1(id INTEGER PRIMARY KEY, a, b, c);
+        CREATE TABLE t1(id INTEGER PRIMARY KEY, a TEXT, b TEXT, c TEXT );
         CREATE INDEX i1 ON t1(a, b);
         CREATE INDEX i2 ON t1(b COLLATE "unicode_ci", c COLLATE "unicode_ci");
 
@@ -201,7 +201,7 @@ test:do_execsql_test(
 
 -- do_test 3.0 {
 --   db eval {
---     CREATE TABLE t3(a INTEGER, b INTEGER, c, UNIQUE(a,b));
+--     CREATE TABLE t3(a INTEGER, b INTEGER, c INT , UNIQUE(a,b));
 --     INSERT INTO t3 VALUES
 --         (null, null, 1),
 --         (null, null, 2),
@@ -229,14 +229,14 @@ if (1 > 0) then
         [[
             DROP TABLE IF EXISTS t1;
             DROP TABLE IF EXISTS t2;
-            CREATE TABLE t1(id primary key, a INTEGER);
+            CREATE TABLE t1(id  INT primary key, a INTEGER);
             INSERT INTO t1 VALUES(1,3);
             INSERT INTO t1 VALUES(2,2);
             INSERT INTO t1 VALUES(3,1);
             INSERT INTO t1 VALUES(4,2);
             INSERT INTO t1 VALUES(5,3);
             INSERT INTO t1 VALUES(6,1);
-            CREATE TABLE t2(x primary key);
+            CREATE TABLE t2(x BLOB primary key);
             INSERT INTO t2
               SELECT DISTINCT
                 CASE a WHEN 1 THEN x'0000000000'
@@ -259,7 +259,7 @@ if (1 > 0) then
         5.1,
         [[
             DROP TABLE IF EXISTS t1;
-            CREATE TABLE t1(id primary key,x);
+            CREATE TABLE t1(id  INT primary key,x INT );
             INSERT INTO t1(id,x) VALUES(1,3),(2,1),(3,5),
                                     (4,2),(5,6),(6,4),
                                     (7,5),(8,1),(9,3);
diff --git a/test/sql-tap/distinctagg.test.lua b/test/sql-tap/distinctagg.test.lua
index daee61418..e55c16b54 100755
--- a/test/sql-tap/distinctagg.test.lua
+++ b/test/sql-tap/distinctagg.test.lua
@@ -22,7 +22,7 @@ test:plan(6)
 test:do_execsql_test(
     "distinctagg-1.1",
     [[
-        CREATE TABLE t1(a,b,c primary key);
+        CREATE TABLE t1(a INT,b INT,c INT primary key);
         INSERT INTO t1 VALUES(1,2,3);
         INSERT INTO t1 VALUES(1,3,4);
         INSERT INTO t1 VALUES(1,3,5);
diff --git a/test/sql-tap/drop_all.test.lua b/test/sql-tap/drop_all.test.lua
index d4f6c6073..86a2587eb 100755
--- a/test/sql-tap/drop_all.test.lua
+++ b/test/sql-tap/drop_all.test.lua
@@ -9,7 +9,7 @@ test:do_test(
     prefix.."1.0",
     function()
         for i = 1, N do
-            test:execsql(string.format("create table table%s(a primary key)", i))
+            test:execsql(string.format("create table table%s(a INT primary key)", i))
         end
 
         for i = 1, N do
diff --git a/test/sql-tap/e_delete.test.lua b/test/sql-tap/e_delete.test.lua
index 6365f3b22..84a4e0a22 100755
--- a/test/sql-tap/e_delete.test.lua
+++ b/test/sql-tap/e_delete.test.lua
@@ -25,7 +25,7 @@ test.do_delete_tests = test.do_select_tests
 test:do_execsql_test(
     "e_delete-0.0",
     [[
-        CREATE TABLE t1(a PRIMARY KEY, b);
+        CREATE TABLE t1(a  INT PRIMARY KEY, b INT );
         CREATE INDEX i1 ON t1(a);
     ]], {
         -- <e_delete-0.0>
@@ -56,7 +56,7 @@ test:do_test(
             "t1", "t2", "t3", "t4", "t5", "t6"
         }
         for _, t in ipairs(tables) do
-            local sql = 'CREATE TABLE '..t..'(x PRIMARY KEY, y);'
+            local sql = 'CREATE TABLE '..t..'(x INT PRIMARY KEY, y TEXT);'
             test:execsql(sql)
         end
 
@@ -114,16 +114,16 @@ if (0 > 0) then
 --   ATTACH 'test.db2' AS aux;
 --   ATTACH 'test.db3' AS aux2;
     [[
-       CREATE TABLE temp.t7(a primary key, b);   INSERT INTO temp.t7 VALUES(1, 2);
-       CREATE TABLE main.t7(a primary key, b);   INSERT INTO main.t7 VALUES(3, 4);
-       CREATE TABLE aux.t7(a primary key, b);    INSERT INTO aux.t7 VALUES(5, 6);
-       CREATE TABLE aux2.t7(a primary key, b);   INSERT INTO aux2.t7 VALUES(7, 8);
-       CREATE TABLE main.t8(a primary key, b);   INSERT INTO main.t8 VALUES(1, 2);
-       CREATE TABLE aux.t8(a primary key, b);    INSERT INTO aux.t8 VALUES(3, 4);
-       CREATE TABLE aux2.t8(a primary key, b);   INSERT INTO aux2.t8 VALUES(5, 6);
-       CREATE TABLE aux.t9(a primary key, b);    INSERT INTO aux.t9 VALUES(1, 2);
-       CREATE TABLE aux2.t9(a primary key, b);   INSERT INTO aux2.t9 VALUES(3, 4);
-       CREATE TABLE aux2.t10(a primary key, b);  INSERT INTO aux2.t10 VALUES(1, 2);]]
+       CREATE TABLE temp.t7(a INT primary key, b INT);   INSERT INTO temp.t7 VALUES(1, 2);
+       CREATE TABLE main.t7(a INT primary key, b INT);   INSERT INTO main.t7 VALUES(3, 4);
+       CREATE TABLE aux.t7(a INT primary key, b INT);    INSERT INTO aux.t7 VALUES(5, 6);
+       CREATE TABLE aux2.t7(a INT primary key, b INT);   INSERT INTO aux2.t7 VALUES(7, 8);
+       CREATE TABLE main.t8(a INT primary key, b INT);   INSERT INTO main.t8 VALUES(1, 2);
+       CREATE TABLE aux.t8(a INT primary key, b INT);    INSERT INTO aux.t8 VALUES(3, 4);
+       CREATE TABLE aux2.t8(a INT primary key, b INT);   INSERT INTO aux2.t8 VALUES(5, 6);
+       CREATE TABLE aux.t9(a INT primary key, b INT);    INSERT INTO aux.t9 VALUES(1, 2);
+       CREATE TABLE aux2.t9(a INT primary key, b INT);   INSERT INTO aux2.t9 VALUES(3, 4);
+       CREATE TABLE aux2.t10(a INT primary key, b INT);  INSERT INTO aux2.t10 VALUES(1, 2);]]
     , {})
 
     -- EVIDENCE-OF: R-09681-58560 The table-name specified as part of a
@@ -349,7 +349,7 @@ if (0 > 0) then
     local function rebuild_t1()
         test:catchsql " DROP TABLE t1 "
         test:execsql [[
-        CREATE TABLE t1(a PRIMARY KEY, b);
+        CREATE TABLE t1(a  INT PRIMARY KEY, b INT );
         INSERT INTO t1 VALUES(1, 'one');
         INSERT INTO t1 VALUES(2, 'two');
         INSERT INTO t1 VALUES(3, 'three');
@@ -479,7 +479,7 @@ if (0 > 0) then
  rebuild_t1 
  catchsql { DROP TABLE t1log }
  execsql {
-   CREATE TABLE t1log(x);
+   CREATE TABLE t1log(x INT );
    CREATE TRIGGER tr1 AFTER DELETE ON t1 BEGIN
      INSERT INTO t1log VALUES(old.a);
    END;
diff --git a/test/sql-tap/e_expr.test.lua b/test/sql-tap/e_expr.test.lua
index 9a9a5faae..ef7adb218 100755
--- a/test/sql-tap/e_expr.test.lua
+++ b/test/sql-tap/e_expr.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(12431)
+test:plan(12425)
 
 --!./tcltestrunner.lua
 -- 2010 July 16
@@ -152,9 +152,9 @@ for _, op1 in ipairs(oplist) do
     for _, op2 in ipairs(oplist) do
         untested[op1..","..op2] = 1
         for tn, val in ipairs(test_cases1) do
-            local A = val[1]
-            local B = val[2]
-            local C = val[3]
+            local A = val[2]
+            local B = val[3]
+            local C = val[4]
             local testname = string.format("e_expr-1.%s.%s.%s", opname[op1], opname[op2], tn)
             -- If ?op2 groups more tightly than ?op1, then the result
             -- of executing ?sql1 whould be the same as executing ?sql3.
@@ -165,21 +165,19 @@ for _, op1 in ipairs(oplist) do
             local sql1 = string.format("SELECT %s %s %s %s %s", A, op1, B, op2, C)
             local sql2 = string.format("SELECT (%s %s %s) %s %s", A, op1, B, op2, C)
             local sql3 = string.format("SELECT %s %s (%s %s %s)", A, op1, B, op2, C)
-            local a2 = test:catchsql(sql2)
-            local a3 = test:catchsql(sql3)
-            local res = opprec[op2] < opprec[op1] and a3 or a2
-
-            if res[1] ~= 0 then
-                --
-                -- gh-2135: Division by zero is forbiden.
-                --
-                test:do_catchsql_test(
-                    testname, sql1,
-                    {1, "Failed to execute SQL statement: division by zero"})
-            else
-                test:do_execsql_test(testname, sql1, res[2])
+            -- Some cases may fail due to wrong type conversions.
+            -- For instance: SELECT 1 + (1 || -1)
+            -- After concatenation we'he got: 1 + '1-1'.
+            -- Since '1-1' can't be converted to number, this
+            -- expression results in error.
+            --
+            local is_ok1, a2 = pcall(test.execsql, test, sql2)
+            local is_ok2, a3 = pcall(test.execsql, test, sql3)
+            if is_ok1 and is_ok2 then
+                test:do_execsql_test(
+                    testname,
+                    sql1, (opprec[op2] < opprec[op1]) and a3 or a2)
             end
-
             if (a2 ~= a3) then
                 untested[op1..","..op2] = nil
             end
@@ -469,29 +467,22 @@ literals = {
 for _, op in ipairs(oplist) do
     for n1, rhs in ipairs(literals) do
         for n2, lhs in ipairs(literals) do
-            local res = test:catchsql(string.format(" SELECT typeof(%s %s %s) ", lhs, op, rhs))
-            local testname = string.format("e_expr-7.%s.%s.%s", opname[op], n1, n2)
-            if res[1] ~= 0 then
-                --
-                -- gh-2135: Division by zero is forbiden.
-                --
-                test:do_test(
-                    testname,
-                    function()
-                        return res[2] == "Failed to execute SQL statement: division by zero"
-                    end, true)
-            else
-                local t = res[2][1]
+            local is_ok, t = pcall(test.execsql, test,
+                                   string.format(" SELECT typeof(%s %s %s) ",
+                                                 lhs, op, rhs))
+            if is_ok then
+                t = t[1]
                 test:do_test(
-                    testname,
+                    string.format("e_expr-7.%s.%s.%s", opname[op], n1, n2),
                     function()
                         return (((op == "||") and ((t == "text") or
                                 (t == "null"))) or
                                 ((op ~= "||") and (((t == "integer") or
-                                        (t == "real")) or
-                                        (t == "null")))) and 1 or 0
-                    end, 1)
+                                (t == "real")) or
+                                (t == "null")))) and 1 or 0
+                end, 1)
             end
+
         end
     end
 end
@@ -849,7 +840,7 @@ test:do_execsql_test(
 -- # clause in a table column definition.
 -- #
 -- do_execsql_test e_expr-9.24 {
---   CREATE TABLE t24(a COLLATE NOCASE, b);
+--   CREATE TABLE t24(a TEXT COLLATE NOCASE, b INT);
 --   INSERT INTO t24 VALUES('aaa', 1);
 --   INSERT INTO t24 VALUES('bbb', 2);
 --   INSERT INTO t24 VALUES('ccc', 3);
@@ -1271,7 +1262,7 @@ test:do_execsql_test(
     })
 
 test:execsql [[
-    CREATE TABLE tblname(cname PRIMARY KEY);
+    CREATE TABLE tblname(cname INT PRIMARY KEY);
 ]]
 local function glob(args)
     return 1
@@ -1332,7 +1323,6 @@ local test_cases12 ={
     {42, "( EXPR )"},
 
     {43, "CAST ( EXPR AS integer )"},
-    {44, "CAST ( EXPR AS 'abcd' )"},
 
     {45, "EXPR COLLATE \"unicode_ci\""},
     {46, "EXPR COLLATE binary"},
@@ -3075,7 +3065,7 @@ evalcount = 0
 test:do_execsql_test(
     "e_expr-26.1.1",
     [[
-        CREATE TABLE t2(x PRIMARY KEY, w1, r1, w2, r2, r3);
+        CREATE TABLE t2(x INT PRIMARY KEY, w1 INT, r1 TEXT, w2 INT, r2 TEXT, r3 TEXT);
         INSERT INTO t2 VALUES(1, 1, 'R1', 2, 'R2', 'R3');
         INSERT INTO t2 VALUES(2, 1, 'R1', 2, 'R2', 'R3');
         INSERT INTO t2 VALUES(3, 1, 'R1', 2, 'R2', 'R3');
@@ -3153,24 +3143,12 @@ test:do_test(
 -- affinity only changes the data type of a value if the change is
 -- lossless and reversible.
 --
-test:do_execsql_test(
-    "e_expr-27.1.1",
-    [[
-        CREATE TABLE t3(a TEXT PRIMARY KEY, b REAL, c INTEGER);
-        INSERT INTO t3 VALUES(X'555655', '1.23abc', 4.5);
-        SELECT typeof(a), a, typeof(b), b, typeof(c), c FROM t3;
-    ]], {
-        -- <e_expr-27.1.1>
-        "blob", "UVU", "text", "1.23abc", "real", 4.5
-        -- </e_expr-27.1.1>
-    })
-
 test:do_execsql_test(
     "e_expr-27.1.2",
     [[
         SELECT
           typeof(CAST(X'555655' as TEXT)), CAST(X'555655' as TEXT),
-          typeof(CAST('1.23abc' as REAL)), CAST('1.23abc' as REAL),
+          typeof(CAST('1.23' as REAL)), CAST('1.23' as REAL),
           typeof(CAST(4.5 as INTEGER)), CAST(4.5 as INTEGER)
     ]], {
         -- <e_expr-27.1.2>
@@ -3184,13 +3162,7 @@ test:do_execsql_test(
 do_expr_test("e_expr-27.2.1", " CAST(NULL AS integer) ", "null", "")
 do_expr_test("e_expr-27.2.2", " CAST(NULL AS text) ", "null", "")
 do_expr_test("e_expr-27.2.3", " CAST(NULL AS blob) ", "null", "")
-do_expr_test("e_expr-27.2.4", " CAST(NULL AS number) ", "null", "")
--- EVIDENCE-OF: R-43522-35548 Casting a value to a type-name with no
--- affinity causes the value to be converted into a BLOB.
---
-do_expr_test("e_expr-27.3.1", " CAST('abc' AS blob)       ", "blob", "abc")
-do_expr_test("e_expr-27.3.2", " CAST('def' AS shobblob_x) ", "blob", "def")
-do_expr_test("e_expr-27.3.3", " CAST('ghi' AS abbLOb10)   ", "blob", "ghi")
+do_expr_test("e_expr-27.2.4", " CAST(NULL AS numeric) ", "null", "")
 -- EVIDENCE-OF: R-22956-37754 Casting to a BLOB consists of first casting
 -- the value to TEXT in the encoding of the database connection, then
 -- interpreting the resulting byte sequence as a BLOB instead of as TEXT.
@@ -3307,10 +3279,10 @@ do_expr_test("e_expr-31.2.4", [[
 -- result into INTEGER if and only if the conversion from REAL to INTEGER
 -- is lossless and reversible.
 --
-do_expr_test("e_expr-32.1.1", " CAST('45'   AS NUMERIC)  ", "integer", 45)
-do_expr_test("e_expr-32.1.2", " CAST('45.0' AS NUMERIC)  ", "integer", 45)
+do_expr_test("e_expr-32.1.1", " CAST('45'   AS NUMERIC)  ", "real", 45)
+do_expr_test("e_expr-32.1.2", " CAST('45.0' AS NUMERIC)  ", "real", 45)
 do_expr_test("e_expr-32.1.3", " CAST('45.2' AS NUMERIC)  ", "real", 45.2)
-do_expr_test("e_expr-32.1.4", " CAST('11abc' AS NUMERIC) ", "integer", 11)
+do_expr_test("e_expr-32.1.4", " CAST('11abc' AS NUMERIC) ", "real", 11)
 do_expr_test("e_expr-32.1.5", " CAST('11.1abc' AS NUMERIC) ", "real", 11.1)
 -- EVIDENCE-OF: R-30347-18702 Casting a REAL or INTEGER value to NUMERIC
 -- is a no-op, even if a real value could be losslessly converted to an
@@ -3320,10 +3292,10 @@ do_expr_test("e_expr-32.2.1", " CAST(13.0 AS NUMERIC) ", "real", 13.0)
 do_expr_test("e_expr-32.2.2", " CAST(13.5 AS NUMERIC) ", "real", 13.5)
 do_expr_test("e_expr-32.2.3", [[
   CAST(-9223372036854775808 AS NUMERIC)
-]], "integer", -9223372036854775808LL)
+]], "real", -9223372036854775808)
 do_expr_test("e_expr-32.2.4", [[
   CAST(9223372036854775807 AS NUMERIC)
-]], "integer", 9223372036854775807LL)
+]], "real", 9223372036854775807)
 -- EVIDENCE-OF: R-64550-29191 Note that the result from casting any
 -- non-BLOB value into a BLOB and the result from casting any BLOB value
 -- into a non-BLOB value may be different depending on whether the
@@ -3337,7 +3309,7 @@ do_expr_test("e_expr-32.2.4", [[
 test:do_execsql_test(
     "e_expr-34.1",
     [[
-        CREATE TABLE t1(id PRIMARY KEY, a, b);
+        CREATE TABLE t1(id INT PRIMARY KEY, a INT, b INT);
         INSERT INTO t1 VALUES(1, 1, 2);
         INSERT INTO t1 VALUES(2, NULL, 2);
         INSERT INTO t1 VALUES(3, 1, NULL);
@@ -3432,10 +3404,9 @@ test:catchsql "DROP TABLE t22;"
 test:do_execsql_test(
     "e_expr-35.0",
     [[
-        CREATE TABLE t22(a PRIMARY KEY, b);
+        CREATE TABLE t22(a TEXT PRIMARY KEY, b TEXT);
         INSERT INTO t22 VALUES('one', 'two');
         INSERT INTO t22 VALUES('three', NULL);
-        INSERT INTO t22 VALUES(4, 5.0);
     ]], {
         -- <e_expr-35.0>
         
@@ -3451,14 +3422,14 @@ test:do_execsql_test(
 --
 do_expr_test("e_expr-35.1.1", " (SELECT 35)   ", "integer", 35)
 do_expr_test("e_expr-35.1.2", " (SELECT NULL) ", "null", "")
-do_expr_test("e_expr-35.1.3", " (SELECT count(*) FROM t22) ", "integer", 3)
+do_expr_test("e_expr-35.1.3", " (SELECT count(*) FROM t22) ", "integer", 2)
 do_expr_test("e_expr-35.1.4", " (SELECT 4 FROM t22 LIMIT 1) ", "integer", 4)
 do_expr_test("e_expr-35.1.5", [[ 
   (SELECT b FROM t22 UNION SELECT a+1 FROM t22 LIMIT 1)
 ]], "null", "")
 do_expr_test("e_expr-35.1.6", [[ 
   (SELECT a FROM t22 UNION SELECT COALESCE(b, 55) FROM t22 ORDER BY 1 LIMIT 1)
-]], "integer", 4)
+]], "integer", 55)
 -- EVIDENCE-OF: R-46899-53765 A SELECT used as a scalar quantity must
 -- return a result set with a single column.
 --
@@ -3491,7 +3462,7 @@ end
 test:do_execsql_test(
     "e_expr-36.3.1",
     [[
-        CREATE TABLE t4(x PRIMARY KEY, y);
+        CREATE TABLE t4(x INT PRIMARY KEY, y TEXT);
         INSERT INTO t4 VALUES(1, 'one');
         INSERT INTO t4 VALUES(2, 'two');
         INSERT INTO t4 VALUES(3, 'three');
diff --git a/test/sql-tap/e_select1.test.lua b/test/sql-tap/e_select1.test.lua
index c8ad9039d..b1e113cc9 100755
--- a/test/sql-tap/e_select1.test.lua
+++ b/test/sql-tap/e_select1.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(541)
+test:plan(525)
 
 --!./tcltestrunner.lua
 -- 2010 July 16
@@ -24,21 +24,21 @@ test:plan(541)
 test:do_execsql_test(
     "e_select-1.0",
     [[
-        CREATE TABLE t1(a PRIMARY KEY, b);
+        CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT);
         INSERT INTO t1 VALUES('a', 'one');
         INSERT INTO t1 VALUES('b', 'two');
         INSERT INTO t1 VALUES('c', 'three');
 
-        CREATE TABLE t2(a PRIMARY KEY, b);
+        CREATE TABLE t2(a TEXT PRIMARY KEY, b TEXT);
         INSERT INTO t2 VALUES('a', 'I');
         INSERT INTO t2 VALUES('b', 'II');
         INSERT INTO t2 VALUES('c', 'III');
 
-        CREATE TABLE t3(a PRIMARY KEY, c);
+        CREATE TABLE t3(a TEXT PRIMARY KEY, c INT);
         INSERT INTO t3 VALUES('a', 1);
         INSERT INTO t3 VALUES('b', 2);
 
-        CREATE TABLE t4(a PRIMARY KEY, c);
+        CREATE TABLE t4(a TEXT PRIMARY KEY, c INT);
         INSERT INTO t4 VALUES('a', NULL);
         INSERT INTO t4 VALUES('b', 2);
     ]], {
@@ -185,7 +185,7 @@ test:do_select_tests(
 
         {"2011.1", "SELECT ALL 1, 2, 3 WHERE 1 GROUP BY 2", {1, 2, 3}},
         {"2012.1", "SELECT ALL 1, 2, 3 WHERE 0 GROUP BY 2 HAVING count(*)=1", {}},
-        {"2012.2", "SELECT ALL 1, 2, 3 WHERE 'abc' GROUP BY 2 HAVING count(*)>1", {}},
+        {"2012.2", "SELECT ALL 1, 2, 3 WHERE 2 GROUP BY 2 HAVING count(*)>1", {}},
 
         {"0111.1", "SELECT count(*), max(a) FROM t1 WHERE a='a' GROUP BY b", {1, "a"}},
         {"0112.1", "SELECT count(*), max(a) FROM t1 WHERE a='c' GROUP BY b HAVING count(*)=1", {1, "c"}},
@@ -298,57 +298,6 @@ test:do_select_tests(
         {"6", "SELECT count(*) WHERE 1", {1}},
     })
 
--- EVIDENCE-OF: R-45424-07352 If there is only a single table or subquery
--- in the FROM clause, then the input data used by the SELECT statement
--- is the contents of the named table.
---
---   The results of the SELECT queries suggest that they are operating on the
---   contents of the table 'xx'.
---
-test:do_execsql_test(
-    "e_select-1.2.0",
-    [[
-        CREATE TABLE xx(id primary key, x, y);
-        INSERT INTO xx VALUES(1, 'IiJlsIPepMuAhU', X'10B00B897A15BAA02E3F98DCE8F2');
-        INSERT INTO xx VALUES(2, NULL, -16.87);
-        INSERT INTO xx VALUES(3, -17.89, 'linguistically');
-    ]], {
-        -- <e_select-1.2.0>
-
-        -- </e_select-1.2.0>
-    })
-
-test:do_select_tests(
-    "e_select-1.2",
-    {
-        {"1", "SELECT quote(x), quote(y) FROM xx", {"'IiJlsIPepMuAhU'", "X'10B00B897A15BAA02E3F98DCE8F2'", "NULL", "-16.87", "-17.89", "'linguistically'" }},
-        {"2", "SELECT count(*), count(x), count(y) FROM xx", {3, 2, 3}},
-        {"3", "SELECT sum(x), sum(y) FROM xx", {-17.89, -16.87}},
-    })
-
--- EVIDENCE-OF: R-28355-09804 If there is more than one table or subquery
--- in FROM clause then the contents of all tables and/or subqueries are
--- joined into a single dataset for the simple SELECT statement to
--- operate on.
---
---   There are more detailed tests for subsequent requirements that add
---   more detail to this idea. We just add a single test that shows that
---   data is coming from each of the three tables following the FROM clause
---   here to show that the statement, vague as it is, is not incorrect.
---
-test:do_select_tests(
-    "e_select-1.3",
-    {
-        {"1", "SELECT * FROM t1, t2, t3", {
-            "a" ,"one" ,"a" ,"I" ,"a" ,1 ,"a" ,"one" ,"a" ,"I" ,"b" ,2 ,"a" ,"one" ,"b" ,"II" ,"a" ,1 ,
-            "a" ,"one" ,"b" ,"II" ,"b" ,2 ,"a" ,"one" ,"c" ,"III" ,"a" ,1 ,"a" ,"one" ,"c" ,"III" ,"b" ,2 ,
-            "b" ,"two" ,"a" ,"I" ,"a" ,1 ,"b" ,"two" ,"a" ,"I" ,"b" ,2 ,"b" ,"two" ,"b" ,"II" ,"a" ,1 ,
-            "b" ,"two" ,"b" ,"II" ,"b" ,2 ,"b" ,"two" ,"c" ,"III" ,"a" ,1 ,"b" ,"two" ,"c" ,"III" ,"b" ,2 ,
-            "c" ,"three" ,"a" ,"I" ,"a" ,1 ,"c" ,"three" ,"a" ,"I" ,"b" ,2 ,"c" ,"three" ,"b" ,"II" ,"a" ,1 ,
-            "c" ,"three" ,"b" ,"II" ,"b" ,2 ,"c" ,"three" ,"c", "III", "a", 1, "c", "three", "c", "III", "b", 2
-        }},
-    })
-
 --
 -- The following block of tests - e_select-1.4.* - test that the description
 -- of cartesian joins in the SELECT documentation is consistent with SQLite.
@@ -377,13 +326,13 @@ test:do_select_tests(
 test:do_execsql_test(
     "e_select-1.4.0",
     [[
-        CREATE TABLE x1(id primary key, a, b);
-        CREATE TABLE x2(id primary key, c, d, e);
-        CREATE TABLE x3(id primary key, f, g, h, i);
+        CREATE TABLE x1(id  INT primary key, a TEXT , b TEXT );
+        CREATE TABLE x2(id  INT primary key, c FLOAT , d FLOAT , e FLOAT );
+        CREATE TABLE x3(id  INT primary key, f TEXT , g TEXT , h TEXT , i TEXT );
 
         -- x1: 3 rows, 2 columns
-        INSERT INTO x1 VALUES(1,24, 'converging');
-        INSERT INTO x1 VALUES(2,NULL, X'CB71');
+        INSERT INTO x1 VALUES(1,'24', 'converging');
+        INSERT INTO x1 VALUES(2, NULL, CAST(X'CB71' as TEXT));
         INSERT INTO x1 VALUES(3,'blonds', 'proprietary');
 
         -- x2: 2 rows, 3 columns
@@ -391,11 +340,11 @@ test:do_execsql_test(
         INSERT INTO x2 VALUES(2,-58, NULL, 1.21);
 
         -- x3: 5 rows, 4 columns
-        INSERT INTO x3 VALUES(1,-39.24, NULL, 'encompass', -1);
-        INSERT INTO x3 VALUES(2,'presenting', 51, 'reformation', 'dignified');
-        INSERT INTO x3 VALUES(3,'conducting', -87.24, 37.56, NULL);
-        INSERT INTO x3 VALUES(4,'coldest', -96, 'dramatists', 82.3);
-        INSERT INTO x3 VALUES(5,'alerting', NULL, -93.79, NULL);
+        INSERT INTO x3 VALUES(1,'-39.24', NULL, 'encompass', '-1');
+        INSERT INTO x3 VALUES(2,'presenting', '51', 'reformation', 'dignified');
+        INSERT INTO x3 VALUES(3,'conducting', '-87.24', '37.56', NULL);
+        INSERT INTO x3 VALUES(4,'coldest', '-96', 'dramatists', '82.3');
+        INSERT INTO x3 VALUES(5,'alerting', NULL, '-93.79', NULL);
     ]], {
         -- <e_select-1.4.0>
 
@@ -408,23 +357,23 @@ test:do_execsql_test(
 --
 do_join_test("e_select-1.4.1.1", [[
   SELECT a,b,c,d,e FROM x1 JOIN_PATTERN x2 LIMIT 1
-]], {24, "converging", -60.06, "", ""})
+]], {"24", "converging", -60.06, "", ""})
 do_join_test("e_select-1.4.1.2", [[
   SELECT c,d,e,a,b FROM x2 JOIN_PATTERN x1 LIMIT 1
-]], {-60.06, "", "", 24, "converging"})
+]], {-60.06, "", "", "24", "converging"})
 do_join_test("e_select-1.4.1.3", [[
   SELECT f,g,h,i,c,d,e FROM x3 JOIN_PATTERN x2 LIMIT 1
-]], {-39.24, "", "encompass", -1, -60.06, "", ""})
+]], {'-39.24', "", "encompass", '-1', -60.06, "", ""})
 do_join_test("e_select-1.4.1.4", [[
   SELECT c,d,e,f,g,h,i FROM x2 JOIN_PATTERN x3 LIMIT 1
-]], {-60.06, "", "", -39.24, "", "encompass", -1})
+]], {-60.06, "", "", '-39.24', "", "encompass", '-1'})
 -- EVIDENCE-OF: R-44414-54710 There is a row in the cartesian product
 -- dataset formed by combining each unique combination of a row from the
 -- left-hand and right-hand datasets.
 --
 do_join_test("e_select-1.4.2.1", [[
   SELECT c,d,e,f,g,h,i FROM x2 JOIN_PATTERN x3 ORDER BY +c, +f
-]], { -60.06, "", "", -39.24, "", "encompass", -1, -60.06, "", "", "alerting", "", -93.79, "", -60.06, "", "", "coldest", -96, "dramatists", 82.3, -60.06, "", "", "conducting", -87.24, 37.56, "", -60.06, "", "", "presenting", 51, "reformation", "dignified", -58, "", 1.21, -39.24, "", "encompass", -1, -58, "", 1.21, "alerting", "", -93.79, "", -58, "", 1.21, "coldest", -96, "dramatists", 82.3, -58, "", 1.21, "conducting", -87.24, 37.56, "", -58, "", 1.21, "presenting", 51, "reformation", "dignified" })
+]], { -60.06,"","","-39.24","","encompass","-1",-60.06,"","","alerting","","-93.79","",-60.06,"","","coldest","-96","dramatists","82.3",-60.06,"","","conducting","-87.24","37.56","",-60.06,"","","presenting","51","reformation","dignified",-58,"",1.21,"-39.24","","encompass","-1",-58,"",1.21,"alerting","","-93.79","",-58,"",1.21,"coldest","-96","dramatists","82.3",-58,"",1.21,"conducting","-87.24","37.56","",-58,"",1.21,"presenting","51","reformation","dignified" })
 -- TODO: Come back and add a few more like the above.
 -- EVIDENCE-OF: R-18439-38548 In other words, if the left-hand dataset
 -- consists of Nleft rows of Mleft columns, and the right-hand dataset of
@@ -502,8 +451,6 @@ local data ={
     {"1"," SELECT * FROM t1 JOIN_PATTERN t2 ON (1) ",t1_cross_t2},
     {"2"," SELECT * FROM t1 JOIN_PATTERN t2 ON (0) ",{}},
     {"3"," SELECT * FROM t1 JOIN_PATTERN t2 ON (NULL) ",{}},
-    {"4"," SELECT * FROM t1 JOIN_PATTERN t2 ON ('abc') ",{}},
-    {"5"," SELECT * FROM t1 JOIN_PATTERN t2 ON ('1ab') ", t1_cross_t2},
     {"6"," SELECT * FROM t1 JOIN_PATTERN t2 ON (0.9) ",t1_cross_t2},
     {"7"," SELECT * FROM t1 JOIN_PATTERN t2 ON ('0.9') ",t1_cross_t2},
     {"8"," SELECT * FROM t1 JOIN_PATTERN t2 ON (0.0) ",{}},
@@ -561,11 +508,11 @@ if (0 > 0)
     test:do_execsql_test(
         "e_select-1.6.0",
         [[
-            CREATE TABLE t5(a COLLATE "unicode_ci", b COLLATE binary);
+            CREATE TABLE t5(a  TEXT COLLATE "unicode_ci", b  TEXT COLLATE binary);
             INSERT INTO t5 VALUES('AA', 'cc');
             INSERT INTO t5 VALUES('BB', 'dd');
             INSERT INTO t5 VALUES(NULL, NULL);
-            CREATE TABLE t6(a COLLATE binary, b COLLATE "unicode_ci");
+            CREATE TABLE t6(a  TEXT COLLATE binary, b  TEXT COLLATE "unicode_ci");
             INSERT INTO t6 VALUES('aa', 'cc');
             INSERT INTO t6 VALUES('bb', 'DD');
             INSERT INTO t6 VALUES(NULL, NULL);
@@ -597,8 +544,8 @@ end
 test:do_execsql_test(
     "e_select-1.8.0",
     [[
-        CREATE TABLE t7(a PRIMARY KEY, b, c);
-        CREATE TABLE t8(a PRIMARY KEY, d, e);
+        CREATE TABLE t7(a TEXT PRIMARY KEY, b TEXT, c INT );
+        CREATE TABLE t8(a TEXT PRIMARY KEY, d TEXT, e INT );
 
         INSERT INTO t7 VALUES('x', 'ex',  24);
         INSERT INTO t7 VALUES('y', 'why', 25);
@@ -668,7 +615,7 @@ test:do_select_tests(
 test:do_execsql_test(
     "e_select-1.11.0",
     [[
-        CREATE TABLE t10(id primary key, x, y);
+        CREATE TABLE t10(id  INT primary key, x INT , y TEXT);
         INSERT INTO t10 VALUES(1, 1, 'true');
         INSERT INTO t10 VALUES(2, 0, 'false');
     ]], {
@@ -710,18 +657,18 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-3.0",
     [[
-        CREATE TABLE x1(id PRIMARY KEY, k, x, y, z);
-        INSERT INTO x1 VALUES(1, 1, 'relinquished', 'aphasia', 78.43);
-        INSERT INTO x1 VALUES(2, 2, X'A8E8D66F',    X'07CF',   -81);
-        INSERT INTO x1 VALUES(3, 3, -22,            -27.57,    NULL);
+        CREATE TABLE x1(id  INT PRIMARY KEY, k INT , x TEXT , y TEXT , z TEXT );
+        INSERT INTO x1 VALUES(1, 1, 'relinquished', 'aphasia', '78.43');
+        INSERT INTO x1 VALUES(2, 2, 'A8E8D66F',    '07CF',   '-81');
+        INSERT INTO x1 VALUES(3, 3, '-22',            '-27.57',    NULL);
         INSERT INTO x1 VALUES(4, 4, NULL,           'bygone',  'picky');
-        INSERT INTO x1 VALUES(5, 5, NULL,           96.28,     NULL);
-        INSERT INTO x1 VALUES(6, 6, 0,              1,         2);
+        INSERT INTO x1 VALUES(5, 5, NULL,           '96.28',     NULL);
+        INSERT INTO x1 VALUES(6, 6, '0',              '1',         '2');
 
-        CREATE TABLE x2(id primary key, k, x, y2);
-        INSERT INTO x2 VALUES(1, 1, 50, X'B82838');
-        INSERT INTO x2 VALUES(2, 5, 84.79, 65.88);
-        INSERT INTO x2 VALUES(3, 3, -22, X'0E1BE452A393');
+        CREATE TABLE x2(id  INT primary key, k INT , x TEXT , y2 TEXT );
+        INSERT INTO x2 VALUES(1, 1, '50', 'B82838');
+        INSERT INTO x2 VALUES(2, 5, '84.79', '65.88');
+        INSERT INTO x2 VALUES(3, 3, '-22', '0E1BE452A393');
         INSERT INTO x2 VALUES(4, 7, 'mistrusted', 'standardized');
     ]], {
         -- <e_select-3.0>
@@ -734,45 +681,6 @@ test:do_execsql_test(
 -- expression. Only rows for which the WHERE clause expression evaluates
 -- to true are included from the dataset before continuing.
 --
-test:do_execsql_test(
-    "e_select-3.1.1",
-    [[
-        SELECT k FROM x1 WHERE x
-    ]], {
-        -- <e_select-3.1.1>
-        3
-        -- </e_select-3.1.1>
-    })
-
-test:do_execsql_test(
-    "e_select-3.1.2",
-    [[
-        SELECT k FROM x1 WHERE y
-    ]], {
-        -- <e_select-3.1.2>
-        3, 5, 6
-        -- </e_select-3.1.2>
-    })
-
-test:do_execsql_test(
-    "e_select-3.1.3",
-    [[
-        SELECT k FROM x1 WHERE z
-    ]], {
-        -- <e_select-3.1.3>
-        1, 2, 6
-        -- </e_select-3.1.3>
-    })
-
-test:do_execsql_test(
-    "e_select-3.1.4",
-    [[
-        SELECT k FROM x1 WHERE '1'||z
-    ]], {
-        -- <e_select-3.1.4>
-        1, 2, 4, 6
-        -- </e_select-3.1.4>
-    })
 
 test:do_execsql_test(
     "e_select-3.1.5",
@@ -784,16 +692,6 @@ test:do_execsql_test(
         -- </e_select-3.1.5>
     })
 
-test:do_execsql_test(
-    "e_select-3.1.6",
-    [[
-        SELECT k FROM x1 WHERE z - 78.43
-    ]], {
-        -- <e_select-3.1.6>
-        2, 4, 6
-        -- </e_select-3.1.6>
-    })
-
 test:do_execsql_test(
     "e_select-3.2.1a",
     [[
@@ -852,21 +750,21 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-4.0",
     [[
-        CREATE TABLE z1(id primary key, a, b, c);
-        CREATE TABLE z2(id primary key, d, e);
-        CREATE TABLE z3(id primary key, a, b);
+        CREATE TABLE z1(id  INT primary key, a FLOAT, b FLOAT, c TEXT);
+        CREATE TABLE z2(id  INT primary key, d FLOAT, e FLOAT);
+        CREATE TABLE z3(id  INT primary key, a FLOAT, b FLOAT);
 
         INSERT INTO z1 VALUES(1, 51.65, -59.58, 'belfries');
         INSERT INTO z1 VALUES(2, -5, NULL, 75);
         INSERT INTO z1 VALUES(3, -2.2, -23.18, 'suiters');
         INSERT INTO z1 VALUES(4, NULL, 67, 'quartets');
         INSERT INTO z1 VALUES(5, -1.04, -32.3, 'aspen');
-        INSERT INTO z1 VALUES(6, 63, 'born', -26);
+        INSERT INTO z1 VALUES(6, 63, '0', -26);
 
         INSERT INTO z2 VALUES(1, NULL, 21);
         INSERT INTO z2 VALUES(2, 36, 6);
 
-        INSERT INTO z3 VALUES(1, 'subsistence', 'gauze');
+        INSERT INTO z3 VALUES(1, 123.21, 123.12);
         INSERT INTO z3 VALUES(2, 49.17, -67);
     ]], {
         -- <e_select-4.0>
@@ -891,9 +789,9 @@ test:do_select_tests(
         {"4", "SELECT z2.d, z2.e FROM z1,z2 LIMIT 1", {"", 21}},
         {"5", "SELECT z2.d, z2.e, z1.a, z1.b, z1.c FROM z1,z2 LIMIT 1", {"", 21, 51.65, -59.58, "belfries"}},
 
-        {"6", "SELECT count(*), a,b,c FROM z1", {6, 63, "born", -26}},
-        {"7", "SELECT max(a), a,b,c FROM z1", {63, 63, "born", -26}},
-        {"8", "SELECT a,b,c, min(a) FROM z1", {-5, "", 75, -5}},
+        {"6", "SELECT count(*), a,b,c FROM z1", {6, 63, 0, "-26"}},
+        {"7", "SELECT max(a), a,b,c FROM z1", {63, 63, 0, "-26"}},
+        {"8", "SELECT a,b,c, min(a) FROM z1", {-5, "", "75", -5}},
 
         {"9", "SELECT a,b,c,d,e,a,b,c,d,e FROM z1,z2 LIMIT 1", {
             51.65, -59.58, "belfries", "", 21, 51.65, -59.58, "belfries", "", 21}},
@@ -970,14 +868,14 @@ end
 test:do_select_tests(
     "e_select-4.4",
     {
-        {"1", "SELECT a, b FROM z1", {51.65, -59.58, -5, "", -2.2, -23.18, "", 67, -1.04, -32.3, 63, "born"}},
+        {"1", "SELECT a, b FROM z1", {51.65, -59.58, -5, "", -2.2, -23.18, "", 67, -1.04, -32.3, 63, 0}},
 
         {"2", "SELECT a IS NULL, b+1, a,b,c FROM z1",
-            {0, -58.58, 51.65, -59.58, "belfries", 0, "", -5, "", 75,
+            {0, -58.58, 51.65, -59.58, "belfries", 0, "", -5, "", "75",
                 0, -22.18, -2.2, -23.18, "suiters", 1, 68, "", 67, "quartets", 0, -31.3,
-                -1.04, -32.3, "aspen", 0, 1, 63, "born", -26}},
+                -1.04, -32.3, "aspen", 0, 1, 63, 0, "-26"}},
 
-        {"3", "SELECT 32*32, d||e FROM z2", {1024, "", 1024, "366"}},
+        {"3", "SELECT 32*32, d||e FROM z2", {1024, "", 1024, "36.06.0"}},
     })
 
 -- Test cases e_select-4.5.* and e_select-4.6.* together show that:
@@ -994,7 +892,7 @@ test:do_select_tests(
 test:do_select_tests(
     "e_select-4.5",
     {
-        {"1", "SELECT count(a), max(a), count(b), max(b) FROM z1", {5, 63, 5, "born"}},
+        {"1", "SELECT count(a), max(a), count(b), max(b) FROM z1", {5, 63, 5, 67}},
         {"2", "SELECT count(*), max(1)", {1, 1}},
 
         {"3", "SELECT sum(b+1) FROM z1 NATURAL LEFT JOIN z3", {-43.06}},
@@ -1018,13 +916,13 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-4.6.0",
     [[
-        CREATE TABLE a1(one PRIMARY KEY, two);
+        CREATE TABLE a1(one  INT PRIMARY KEY, two INT );
         INSERT INTO a1 VALUES(1, 1);
         INSERT INTO a1 VALUES(2, 3);
         INSERT INTO a1 VALUES(3, 6);
         INSERT INTO a1 VALUES(4, 10);
 
-        CREATE TABLE a2(one PRIMARY KEY, three);
+        CREATE TABLE a2(one  INT PRIMARY KEY, three INT );
         INSERT INTO a2 VALUES(1, 1);
         INSERT INTO a2 VALUES(3, 2);
         INSERT INTO a2 VALUES(6, 3);
@@ -1083,7 +981,7 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-4.9.0",
     [[
-        CREATE TABLE b1(one PRIMARY KEY, two);
+        CREATE TABLE b1(one  INT PRIMARY KEY, two TEXT);
         INSERT INTO b1 VALUES(1, 'o');
         INSERT INTO b1 VALUES(4, 'f');
         INSERT INTO b1 VALUES(3, 't');
@@ -1092,14 +990,14 @@ test:do_execsql_test(
         INSERT INTO b1 VALUES(7, 's');
         INSERT INTO b1 VALUES(6, 's');
 
-        CREATE TABLE b2(x, y PRIMARY KEY);
+        CREATE TABLE b2(x TEXT, y  INT PRIMARY KEY);
         INSERT INTO b2 VALUES(NULL, 0);
         INSERT INTO b2 VALUES(NULL, 1);
         INSERT INTO b2 VALUES('xyz', 2);
         INSERT INTO b2 VALUES('abc', 3);
         INSERT INTO b2 VALUES('xyz', 4);
 
-        CREATE TABLE b3(id PRIMARY KEY, a COLLATE "unicode_ci", b COLLATE binary);
+        CREATE TABLE b3(id  INT PRIMARY KEY, a  TEXT COLLATE "unicode_ci", b  TEXT COLLATE binary);
         INSERT INTO b3 VALUES(1, 'abc', 'abc');
         INSERT INTO b3 VALUES(2, 'aBC', 'aBC');
         INSERT INTO b3 VALUES(3, 'Def', 'Def');
@@ -1200,7 +1098,7 @@ end
 test:do_execsql_test(
     "e_select-4.13.0",
     [[
-        CREATE TABLE c1(up, down PRIMARY KEY);
+        CREATE TABLE c1(up TEXT, down  INT PRIMARY KEY);
         INSERT INTO c1 VALUES('x', 1);
         INSERT INTO c1 VALUES('x', 2);
         INSERT INTO c1 VALUES('x', 4);
@@ -1208,7 +1106,7 @@ test:do_execsql_test(
         INSERT INTO c1 VALUES('y', 16);
         INSERT INTO c1 VALUES('y', 32);
 
-        CREATE TABLE c2(i PRIMARY KEY, j);
+        CREATE TABLE c2(i  INT PRIMARY KEY, j INT );
         INSERT INTO c2 VALUES(1, 0);
         INSERT INTO c2 VALUES(2, 1);
         INSERT INTO c2 VALUES(3, 3);
@@ -1219,7 +1117,7 @@ test:do_execsql_test(
         INSERT INTO c2 VALUES(8, 28);
         INSERT INTO c2 VALUES(9, 36);
 
-        CREATE TABLE c3(i PRIMARY KEY, k TEXT);
+        CREATE TABLE c3(i  INT PRIMARY KEY, k TEXT);
         INSERT INTO c3 VALUES(1,  'hydrogen');
         INSERT INTO c3 VALUES(2,  'helium');
         INSERT INTO c3 VALUES(3,  'lithium');
@@ -1303,7 +1201,7 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-5.1.0",
     [[
-        CREATE TABLE h1(id primary key, a, b);
+        CREATE TABLE h1(id  INT primary key, a INT , b TEXT);
         INSERT INTO h1 VALUES(1, 1, 'one');
         INSERT INTO h1 VALUES(2, 1, 'I');
         INSERT INTO h1 VALUES(3, 1, 'i');
@@ -1311,7 +1209,7 @@ test:do_execsql_test(
         INSERT INTO h1 VALUES(5, 4, 'IV');
         INSERT INTO h1 VALUES(6, 4, 'iv');
 
-        CREATE TABLE h2(id primary key, x COLLATE "unicode_ci");
+        CREATE TABLE h2(id  INT primary key, x  TEXT COLLATE "unicode_ci");
         INSERT INTO h2 VALUES(1, 'One');
         INSERT INTO h2 VALUES(2, 'Two');
         INSERT INTO h2 VALUES(3, 'Three');
@@ -1321,7 +1219,7 @@ test:do_execsql_test(
         INSERT INTO h2 VALUES(7, 'three');
         INSERT INTO h2 VALUES(8, 'four');
 
-        CREATE TABLE h3(c PRIMARY KEY, d);
+        CREATE TABLE h3(c  INT PRIMARY KEY, d TEXT);
         INSERT INTO h3 VALUES(1, NULL);
         INSERT INTO h3 VALUES(2, NULL);
         INSERT INTO h3 VALUES(3, NULL);
@@ -1411,9 +1309,9 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-7.1.0",
     [[
-        CREATE TABLE j1(a PRIMARY KEY, b, c);
-        CREATE TABLE j2(e PRIMARY KEY, f);
-        CREATE TABLE j3(g PRIMARY KEY);
+        CREATE TABLE j1(a  INT PRIMARY KEY, b INT , c INT );
+        CREATE TABLE j2(e  INT PRIMARY KEY, f INT );
+        CREATE TABLE j3(g  INT PRIMARY KEY);
     ]], {
         -- <e_select-7.1.0>
 
@@ -1557,9 +1455,9 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-7.4.0",
     [[
-        CREATE TABLE q1(id primary key, a TEXT, b INTEGER, c);
-        CREATE TABLE q2(id primary key, d NUMBER, e BLOB);
-        CREATE TABLE q3(id primary key, f REAL, g);
+        CREATE TABLE q1(id  INT primary key, a TEXT, b FLOAT, c FLOAT);
+        CREATE TABLE q2(id  INT primary key, d TEXT, e FLOAT);
+        CREATE TABLE q3(id  INT primary key, f TEXT, g INT);
 
         INSERT INTO q1 VALUES(1, 16, -87.66, NULL);
         INSERT INTO q1 VALUES(2, 'legible', 94, -42.47);
@@ -1567,7 +1465,7 @@ test:do_execsql_test(
 
         INSERT INTO q2 VALUES(1, 'legible', 1);
         INSERT INTO q2 VALUES(2, 'beauty', 2);
-        INSERT INTO q2 VALUES(3, -65.91, 4);
+        INSERT INTO q2 VALUES(3, -65, 4);
         INSERT INTO q2 VALUES(4, 'emanating', -16.56);
 
         INSERT INTO q3 VALUES(1, 'beauty', 2);
@@ -1581,9 +1479,9 @@ test:do_execsql_test(
 test:do_select_tests(
     "e_select-7.4",
     {
-        {1, "SELECT a FROM q1 UNION ALL SELECT d FROM q2", {"16", "legible", "beauty", "legible", "beauty", -65.91, "emanating"}},
+        {1, "SELECT a FROM q1 UNION ALL SELECT d FROM q2", {"16", "legible", "beauty", "legible", "beauty", "-65", "emanating"}},
         {"3", "SELECT count(*) FROM q1 UNION ALL SELECT min(e) FROM q2", {3, -16.56}},
-        {"4", "SELECT d,e FROM q2 UNION ALL SELECT f,g FROM q3", {"legible" , 1, "beauty", 2, -65.91, 4, "emanating", -16.56, "beauty", 2, "beauty", 2}},
+        {"4", "SELECT d,e FROM q2 UNION ALL SELECT f,g FROM q3", {"legible" , 1, "beauty", 2, "-65", 4, "emanating", -16.56, "beauty", 2, "beauty", 2}},
         })
 
 -- EVIDENCE-OF: R-20560-39162 The UNION operator works the same way as
@@ -1594,13 +1492,13 @@ test:do_select_tests(
     "e_select-7.5",
     {
         {1, "SELECT a FROM q1 UNION SELECT d FROM q2",
-            {-65.91, "16", "beauty", "emanating", "legible"}},
+            {"-65", "16", "beauty", "emanating", "legible"}},
 
         {3, "SELECT count(*) FROM q1 UNION SELECT min(e) FROM q2",
             {-16.56, 3}},
 
         {4, "SELECT d,e FROM q2 UNION SELECT f,g FROM q3",
-            {-65.91, 4, "beauty", 2, "emanating", -16.56, "legible", 1}}
+            {"-65", 4, "beauty", 2, "emanating", -16.56, "legible", 1}}
     })
 
 -- EVIDENCE-OF: R-45764-31737 The INTERSECT operator returns the
@@ -1621,7 +1519,7 @@ test:do_select_tests(
     "e_select-7.7",
     {
         {"1", "SELECT a FROM q1 EXCEPT SELECT d FROM q2", {"16"}},
-        {"2", "SELECT d,e FROM q2 EXCEPT SELECT f,g FROM q3", {-65.91, 4, "emanating", -16.56, "legible", 1}},
+        {"2", "SELECT d,e FROM q2 EXCEPT SELECT f,g FROM q3", {"-65", 4, "emanating", -16.56, "legible", 1}},
     })
 
 -- EVIDENCE-OF: R-40729-56447 Duplicate rows are removed from the results
@@ -1676,7 +1574,7 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-7.10.0",
     [[
-        CREATE TABLE y1(a COLLATE "unicode_ci" PRIMARY KEY, b COLLATE binary, c);
+        CREATE TABLE y1(a  TEXT COLLATE "unicode_ci" PRIMARY KEY, b  TEXT COLLATE binary, c INT );
         INSERT INTO y1 VALUES('Abc', 'abc', 'aBC');
     ]], {
         -- <e_select-7.10.0>
@@ -1705,8 +1603,8 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-7.10.0",
     [[
-        CREATE TABLE w1(a TEXT PRIMARY KEY, b NUMBER);
-        CREATE TABLE w2(a PRIMARY KEY, b TEXT);
+        CREATE TABLE w1(a TEXT PRIMARY KEY, b FLOAT);
+        CREATE TABLE w2(a  INT PRIMARY KEY, b TEXT);
 
         INSERT INTO w1 VALUES('1', 4.1);
         INSERT INTO w2 VALUES(1, 4.1);
@@ -1754,7 +1652,7 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-7.12.0",
     [[
-        CREATE TABLE t1(x PRIMARY KEY);
+        CREATE TABLE t1(x  INT PRIMARY KEY);
         INSERT INTO t1 VALUES(1);
         INSERT INTO t1 VALUES(2);
         INSERT INTO t1 VALUES(3);
@@ -1793,7 +1691,7 @@ test:drop_all_tables()
 test:do_execsql_test(
     "e_select-8.1.0",
     [[
-        CREATE TABLE d1(id primary key, x, y, z);
+        CREATE TABLE d1(id  INT primary key, x INT , y INT , z INT );
 
         INSERT INTO d1 VALUES(1, 1, 2, 3);
         INSERT INTO d1 VALUES(2, 2, 5, -1);
@@ -1804,7 +1702,7 @@ test:do_execsql_test(
         INSERT INTO d1 VALUES(7, 1, 4, 93);
         INSERT INTO d1 VALUES(8, 1, 5, -1);
 
-        CREATE TABLE d2(id primary key, a, b);
+        CREATE TABLE d2(id  INT primary key, a TEXT, b TEXT);
         INSERT INTO d2 VALUES(1, 'gently', 'failings');
         INSERT INTO d2 VALUES(2, 'commercials', 'bathrobe');
         INSERT INTO d2 VALUES(3, 'iterate', 'sexton');
@@ -1981,16 +1879,16 @@ test:do_select_tests(
 test:do_execsql_test(
     "e_select-8.8.0",
     [[
-        CREATE TABLE d3(id primary key, a);
-        INSERT INTO d3 VALUES(1, 'text');
+        CREATE TABLE d3(id  INT primary key, a FLOAT);
+        INSERT INTO d3 VALUES(1, 0);
         INSERT INTO d3 VALUES(2, 14.1);
         INSERT INTO d3 VALUES(3, 13);
-        INSERT INTO d3 VALUES(4, X'78787878');
+        INSERT INTO d3 VALUES(4, 78787878);
         INSERT INTO d3 VALUES(5, 15);
         INSERT INTO d3 VALUES(6, 12.9);
         INSERT INTO d3 VALUES(7, null);
 
-        CREATE TABLE d4(id primary key, x COLLATE "unicode_ci");
+        CREATE TABLE d4(id  INT primary key, x  TEXT COLLATE "unicode_ci");
         INSERT INTO d4 VALUES(1, 'abc');
         INSERT INTO d4 VALUES(2, 'ghi');
         INSERT INTO d4 VALUES(3, 'DEF');
@@ -2013,7 +1911,7 @@ test:do_execsql_test(
         SELECT a FROM d3 ORDER BY a
     ]], {
         -- <e_select-8.8.1>
-        "", 12.9, 13, 14.1, 15, "text", "xxxx"
+        "", 0, 12.9, 13, 14.1, 15, 78787878
         -- </e_select-8.8.1>
     })
 
@@ -2023,7 +1921,7 @@ test:do_execsql_test(
         SELECT a FROM d3 ORDER BY a DESC
     ]], {
         -- <e_select-8.8.2>
-        "xxxx", "text", 15, 14.1, 13, 12.9, ""
+        78787878, 15, 14.1, 13, 12.9, 0, ""
         -- </e_select-8.8.2>
     })
 
@@ -2139,9 +2037,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "e_select-8.13.0",
     [[
-        CREATE TABLE d5(a PRIMARY KEY, b);
-        CREATE TABLE d6(c PRIMARY KEY, d);
-        CREATE TABLE d7(e PRIMARY KEY, f);
+        CREATE TABLE d5(a  INT PRIMARY KEY, b TEXT);
+        CREATE TABLE d6(c  INT PRIMARY KEY, d TEXT);
+        CREATE TABLE d7(e  INT PRIMARY KEY, f TEXT);
 
         INSERT INTO d5 VALUES(1, 'f');
         INSERT INTO d6 VALUES(2, 'e');
@@ -2150,8 +2048,8 @@ test:do_execsql_test(
         INSERT INTO d6 VALUES(5, 'b');
         INSERT INTO d7 VALUES(6, 'a');
 
-        CREATE TABLE d8(x COLLATE "unicode_ci" PRIMARY KEY);
-        CREATE TABLE d9(y COLLATE "unicode_ci" PRIMARY KEY);
+        CREATE TABLE d8(x  TEXT COLLATE "unicode_ci" PRIMARY KEY);
+        CREATE TABLE d9(y  TEXT COLLATE "unicode_ci" PRIMARY KEY);
 
         INSERT INTO d8 VALUES('a');
         INSERT INTO d9 VALUES('B');
@@ -2216,7 +2114,7 @@ test:do_select_tests(
 test:do_execsql_test(
     "e_select-9.0",
     [[
-        CREATE TABLE f1(id primary key, a, b);
+        CREATE TABLE f1(id  INT primary key, a INT, b TEXT);
         INSERT INTO f1 VALUES(1, 26, 'z');
         INSERT INTO f1 VALUES(2, 25, 'y');
         INSERT INTO f1 VALUES(3, 24, 'x');
diff --git a/test/sql-tap/eqp.test.lua b/test/sql-tap/eqp.test.lua
index 8a2c5e269..24165759c 100755
--- a/test/sql-tap/eqp.test.lua
+++ b/test/sql-tap/eqp.test.lua
@@ -32,11 +32,11 @@ local testprefix = "eqp"
 test:do_execsql_test(
     1.1,
     [[
-        CREATE TABLE t1(idt1 primary key, a INT, b INT, ex TEXT);
+        CREATE TABLE t1(idt1  INT primary key, a INT, b INT, ex TEXT);
         CREATE INDEX i1 ON t1(a);
         CREATE INDEX i2 ON t1(b);
-        CREATE TABLE t2(idt2 primary key, a INT, b INT, ex TEXT);
-        CREATE TABLE t3(idt3 primary key, a INT, b INT, ex TEXT);
+        CREATE TABLE t2(idt2  INT primary key, a INT, b INT, ex TEXT);
+        CREATE TABLE t3(idt3  INT primary key, a INT, b INT, ex TEXT);
     ]])
 
 test:do_eqp_test(
@@ -181,9 +181,9 @@ test:drop_all_tables()
 test:do_execsql_test(
     2.1,
     [[
-        CREATE TABLE t1(idt1 primary key, x INT, y INT, ex TEXT);
+        CREATE TABLE t1(idt1  INT primary key, x INT, y INT, ex TEXT);
 
-        CREATE TABLE t2(idt2 primary key, x INT, y INT, ex TEXT);
+        CREATE TABLE t2(idt2  INT primary key, x INT, y INT, ex TEXT);
         CREATE INDEX t2i1 ON t2(x);
     ]])
 
@@ -519,7 +519,7 @@ test:drop_all_tables()
 test:do_execsql_test(
     "5.1.0",
     [[
-        CREATE TABLE t1(idt1 PRIMARY KEY, a INT, b INT, ex TEXT) 
+        CREATE TABLE t1(idt1  INT PRIMARY KEY, a INT, b INT, ex TEXT) 
     ]])
 
 test:do_eqp_test("5.1.1", "SELECT a, b FROM t1 WHERE a=1", {
@@ -562,7 +562,7 @@ test:do_eqp_test("5.3.1", "SELECT a, b FROM t1 WHERE a=1", {
 test:do_execsql_test(
     "5.4.0",
     [[
-        CREATE TABLE t2(idt2 primary key, c INT, d INT, ex TEXT)
+        CREATE TABLE t2(idt2  INT primary key, c INT, d INT, ex TEXT)
     ]])
 
 test:do_eqp_test("5.4.1", "SELECT t1.a, t2.c FROM t1, t2 WHERE t1.a=1 AND t1.b>2", {
@@ -727,8 +727,8 @@ test:drop_all_tables()
 test:do_execsql_test(
     7.0,
     [[
-        CREATE TABLE t1(idt1 primary key, a INT, b INT, ex CHAR(100));
-        CREATE TABLE t2(idt2 primary key, a INT, b INT, ex CHAR(100));
+        CREATE TABLE t1(idt1  INT primary key, a INT, b INT, ex CHAR(100));
+        CREATE TABLE t2(idt2  INT primary key, a INT, b INT, ex CHAR(100));
         CREATE INDEX i1 ON t2(a);
     ]])
 
@@ -770,8 +770,8 @@ test:drop_all_tables()
 test:do_execsql_test(
     8.0,
     [[
-        CREATE TABLE t1(a, b, c, PRIMARY KEY(b, c));
-        CREATE TABLE t2(id primary key, a, b, c);
+        CREATE TABLE t1(a INT , b INT , c INT , PRIMARY KEY(b, c));
+        CREATE TABLE t2(id  INT primary key, a INT , b INT , c INT );
     ]])
 
 test:do_eqp_test("8.1.1", "SELECT * FROM t2", {
diff --git a/test/sql-tap/fkey1.test.lua b/test/sql-tap/fkey1.test.lua
index 3c29b097d..277535228 100755
--- a/test/sql-tap/fkey1.test.lua
+++ b/test/sql-tap/fkey1.test.lua
@@ -7,7 +7,7 @@ test:plan(18)
 test:do_execsql_test(
     "fkey1-1.1",
     [[
-        CREATE TABLE t2(x PRIMARY KEY, y TEXT, UNIQUE (x, y));
+        CREATE TABLE t2(x INT PRIMARY KEY, y TEXT, UNIQUE (x, y));
     ]], {
         -- <fkey1-1.1>
         -- </fkey1-1.1>
@@ -17,11 +17,11 @@ test:do_execsql_test(
     "fkey1-1.2",
     [[
         CREATE TABLE t1(
-            a PRIMARY KEY,
+            a INT PRIMARY KEY,
             b INTEGER
                 REFERENCES t1 ON DELETE CASCADE
                 REFERENCES t2 (x),
-            c TEXT,
+            c TEXT UNIQUE,
             FOREIGN KEY (b, c) REFERENCES t2(x, y) ON UPDATE CASCADE);
     ]], {
         -- <fkey1-1.1>
@@ -32,8 +32,8 @@ test:do_execsql_test(
     "fkey1-1.3",
     [[
         CREATE TABLE t3(
-            a PRIMARY KEY REFERENCES t2,
-            b INTEGER REFERENCES t1,
+            a INT PRIMARY KEY REFERENCES t2,
+            b TEXT REFERENCES t1(c),
             FOREIGN KEY (a, b) REFERENCES t2(x, y));
     ]], {
         -- <fkey1-1.3>
@@ -64,8 +64,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "fkey1-3.1",
     [[
-        CREATE TABLE t5(a PRIMARY KEY, b, c UNIQUE, UNIQUE(a, b));
-        CREATE TABLE t6(d REFERENCES t5, e PRIMARY KEY REFERENCES t5(c));
+        CREATE TABLE t5(a INTEGER PRIMARY KEY, b INT , c INT UNIQUE, UNIQUE(a, b) );
+        CREATE TABLE t6(d  INT REFERENCES t5, e  INT PRIMARY KEY REFERENCES t5(c));
         PRAGMA foreign_key_list(t6);
     ]], {
         -- <fkey1-3.1>
@@ -77,7 +77,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "fkey1-3.2",
     [[
-        CREATE TABLE t7(d PRIMARY KEY, e, f, FOREIGN KEY (d, e) REFERENCES t5(a, b));
+        CREATE TABLE t7(d  INT PRIMARY KEY, e INT , f INT , FOREIGN KEY (d, e) REFERENCES t5(a, b));
         PRAGMA foreign_key_list(t7);
     ]], {
         -- <fkey1-3.2>
@@ -90,7 +90,7 @@ test:do_execsql_test(
     "fkey1-3.3",
     [[
         CREATE TABLE t8(
-            d PRIMARY KEY, e, f,
+            d  INT PRIMARY KEY, e INT , f INT ,
             FOREIGN KEY (d, e) REFERENCES t5(a, b) ON DELETE CASCADE ON UPDATE SET NULL);
         PRAGMA foreign_key_list(t8);
     ]], {
@@ -104,7 +104,7 @@ test:do_execsql_test(
     "fkey1-3.4",
     [[
         CREATE TABLE t9(
-            d PRIMARY KEY, e, f,
+            d  INT PRIMARY KEY, e INT , f INT ,
             FOREIGN KEY (d, e) REFERENCES t5(a, b) ON DELETE CASCADE ON UPDATE SET DEFAULT);
         PRAGMA foreign_key_list(t9);
     ]], {
@@ -144,8 +144,8 @@ test:do_execsql_test(
     "fkey1-5.1",
     [[
         CREATE TABLE t11(
-            x PRIMARY KEY,
-            parent REFERENCES t11 ON DELETE CASCADE);
+            x INTEGER PRIMARY KEY,
+            parent  INT REFERENCES t11 ON DELETE CASCADE);
         INSERT INTO t11 VALUES(1, NULL), (2, 1), (3, 2);
     ]], {
         -- <fkey1-5.1>
@@ -176,9 +176,9 @@ test:do_execsql_test(
     "fkey1-5.4",
     [[
         CREATE TABLE Foo (
-            Id PRIMARY KEY,
+            Id INT PRIMARY KEY,
             ParentId INTEGER REFERENCES Foo(Id) ON DELETE CASCADE,
-            C1);
+            C1 TEXT);
         INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (1, null, 'A');
         INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (2, 1, 'A-2-1');
         INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (3, 2, 'A-3-2');
@@ -211,10 +211,10 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "fkey1-6.1",
     [[
-        CREATE TABLE p1(id PRIMARY KEY, x, y);
+        CREATE TABLE p1(id INT PRIMARY KEY, x INT, y INT);
         CREATE INDEX p1x ON p1(x);
         INSERT INTO p1 VALUES(1, 1, 1);
-        CREATE TABLE c1(a PRIMARY KEY REFERENCES p1(x));
+        CREATE TABLE c1(a INT PRIMARY KEY REFERENCES p1(x));
     ]], {
         -- <fkey1-6.1>
         1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C1': referenced fields don't compose unique index"
@@ -226,7 +226,7 @@ test:do_execsql_test(
     [[
         CREATE UNIQUE INDEX p1x2 ON p1(x);
         DROP TABLE IF EXISTS c1;
-        CREATE TABLE c1(a PRIMARY KEY REFERENCES p1(x));
+        CREATE TABLE c1(a INT PRIMARY KEY REFERENCES p1(x));
         INSERT INTO c1 VALUES(1);
     ]], {
         -- <fkey1-6.3>
diff --git a/test/sql-tap/fkey2.test.lua b/test/sql-tap/fkey2.test.lua
index 140f83543..55849bdf8 100755
--- a/test/sql-tap/fkey2.test.lua
+++ b/test/sql-tap/fkey2.test.lua
@@ -7,14 +7,15 @@ test:plan(116)
 test:do_execsql_test(
     "fkey2-1.1",
     [[
-        CREATE TABLE t1(a PRIMARY KEY, b);
-        CREATE TABLE t2(c PRIMARY KEY REFERENCES t1(a), d);
+        CREATE TABLE t1(a  INT PRIMARY KEY, b INT );
+        CREATE TABLE t2(c  INT PRIMARY KEY REFERENCES t1(a), d INT);
 
-        CREATE TABLE t3(a PRIMARY KEY, b);
-        CREATE TABLE t4(c PRIMARY KEY REFERENCES t3, d);
+        CREATE TABLE t3(a  INT PRIMARY KEY, b INT );
+        CREATE TABLE t4(c  INT PRIMARY KEY REFERENCES t3, d INT );
+
+        CREATE TABLE t7(a INT , b INTEGER PRIMARY KEY);
+        CREATE TABLE t8(c  INT PRIMARY KEY REFERENCES t7, d INT );
 
-        CREATE TABLE t7(a, b INTEGER PRIMARY KEY);
-        CREATE TABLE t8(c INTEGER PRIMARY KEY REFERENCES t7, d);
     ]], {
         -- <fkey2-1.1>
         -- </fkey2-1.1>
@@ -298,7 +299,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "fkey2-1.29",
     [[
-        CREATE TABLE t9(a PRIMARY KEY REFERENCES nosuchtable, b);
+        CREATE TABLE t9(a INT PRIMARY KEY REFERENCES nosuchtable, b);
     ]], {
         1, "Space 'NOSUCHTABLE' does not exist"
     })
@@ -340,13 +341,13 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey2-3.1",
     [[
-        CREATE TABLE ab(a PRIMARY KEY, b);
+        CREATE TABLE ab(a  INT PRIMARY KEY, b TEXT);
         CREATE TABLE cd(
-            c PRIMARY KEY REFERENCES ab ON UPDATE CASCADE ON DELETE CASCADE,
-            d);
+            c  INT PRIMARY KEY REFERENCES ab ON UPDATE CASCADE ON DELETE CASCADE,
+            d TEXT);
         CREATE TABLE ef(
-            e PRIMARY KEY REFERENCES cd ON UPDATE CASCADE,
-            f, CHECK (e!=5));
+            e  INT PRIMARY KEY REFERENCES cd ON UPDATE CASCADE,
+            f TEXT , CHECK (e!=5));
 
         INSERT INTO ab VALUES(1, 'b');
         INSERT INTO cd VALUES(1, 'd');
@@ -423,9 +424,9 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS t2;
         DROP TABLE IF EXISTS t1;
         CREATE TABLE t1(
-            node PRIMARY KEY,
-            parent REFERENCES t1 ON DELETE CASCADE);
-        CREATE TABLE t2(node PRIMARY KEY, parent);
+            node  INT PRIMARY KEY,
+            parent  INT REFERENCES t1 ON DELETE CASCADE);
+        CREATE TABLE t2(node  INT PRIMARY KEY, parent INT );
         CREATE TRIGGER t2t AFTER DELETE ON t2 BEGIN
             DELETE FROM t2 WHERE parent = old.node;
         END;
@@ -472,9 +473,9 @@ test:do_execsql_test(
         DROP TABLE t2;
         DROP TABLE t1;
         CREATE TABLE t1(
-            node PRIMARY KEY,
-            parent REFERENCES t1 ON DELETE CASCADE);
-        CREATE TABLE t2(node PRIMARY KEY, parent);
+            node  INT PRIMARY KEY,
+            parent  INT REFERENCES t1 ON DELETE CASCADE);
+        CREATE TABLE t2(node  INT PRIMARY KEY, parent INT );
         CREATE TRIGGER t2t AFTER DELETE ON t2 BEGIN
             DELETE FROM t2 WHERE parent = old.node;
         END;
@@ -524,8 +525,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(c INTEGER PRIMARY KEY REFERENCES t1, b);
+        CREATE TABLE t1(a  INT PRIMARY KEY, b INT );
+        CREATE TABLE t2(c INTEGER PRIMARY KEY REFERENCES t1, b TEXT);
     ]], {
         -- <fkey2-5.1>
         -- </fkey2-5.1>
@@ -600,10 +601,10 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t2;
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a PRIMARY KEY, b);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
         CREATE TABLE t2(
             c INTEGER PRIMARY KEY,
-            d DEFAULT 1 REFERENCES t1 ON DELETE SET DEFAULT);
+            d INTEGER DEFAULT 1 REFERENCES t1 ON DELETE SET DEFAULT);
         DELETE FROM t1;
     ]], {
         -- <fkey2-6.1>
@@ -660,8 +661,8 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey2-6.6",
     [[
-        CREATE TABLE pp(a, b, c, PRIMARY KEY(b, c));
-        CREATE TABLE cc(d DEFAULT 3, e DEFAULT 1, f DEFAULT 2, id PRIMARY KEY,
+        CREATE TABLE pp(a INT , b INT , c INT , PRIMARY KEY(b, c));
+        CREATE TABLE cc(d  INT DEFAULT 3, e TEXT DEFAULT '1', f  INT DEFAULT 2, id  INT PRIMARY KEY,
             FOREIGN KEY(f, d) REFERENCES pp
             ON UPDATE SET DEFAULT
             ON DELETE SET NULL);
@@ -696,7 +697,7 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t4;
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE t3(x PRIMARY KEY REFERENCES t3 ON DELETE SET NULL);
+        CREATE TABLE t3(x  INT PRIMARY KEY REFERENCES t3 ON DELETE SET NULL);
         INSERT INTO t3(x) VALUES(12345);
         DROP TABLE t3;
         DROP TABLE IF EXISTS t2;
@@ -712,8 +713,8 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "fkey2-7.1",
     [[
-        CREATE TABLE p(a PRIMARY KEY, b);
-        CREATE TABLE c(x PRIMARY KEY REFERENCES p(c));
+        CREATE TABLE p(a INT PRIMARY KEY, b INT);
+        CREATE TABLE c(x INT PRIMARY KEY REFERENCES p(c));
     ]], {
         -- <fkey2-7.1>
         1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C': foreign key refers to nonexistent field C"
@@ -724,7 +725,7 @@ test:do_catchsql_test(
     "fkey2-7.2",
     [[
         CREATE VIEW v AS SELECT b AS y FROM p;
-        CREATE TABLE c(x PRIMARY KEY REFERENCES v(y));
+        CREATE TABLE c(x  INT PRIMARY KEY REFERENCES v(y));
     ]], {
         -- <fkey2-7.2>
         1, "referenced table can't be view"
@@ -737,9 +738,9 @@ test:do_catchsql_test(
         DROP VIEW v;
         DROP TABLE IF EXISTS c;
         DROP TABLE IF EXISTS p;
-        CREATE TABLE p(a COLLATE "unicode_ci", b PRIMARY KEY);
+        CREATE TABLE p(a TEXT COLLATE "unicode_ci", b INT PRIMARY KEY);
         CREATE UNIQUE INDEX idx ON p(a);
-        CREATE TABLE c(x PRIMARY KEY REFERENCES p(a));
+        CREATE TABLE c(x TEXT PRIMARY KEY REFERENCES p(a));
     ]], {
         -- <fkey2-7.3>
         1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C': field collation mismatch"
@@ -751,8 +752,8 @@ test:do_catchsql_test(
     [[
         DROP TABLE IF EXISTS c;
         DROP TABLE IF EXISTS p;
-        CREATE TABLE p(a, b, PRIMARY KEY(a, b));
-        CREATE TABLE c(x PRIMARY KEY REFERENCES p);
+        CREATE TABLE p(a INT, b INT, PRIMARY KEY(a, b));
+        CREATE TABLE c(x INT PRIMARY KEY REFERENCES p);
     ]], {
         -- <fkey2-7.4>
         1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
@@ -765,8 +766,8 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey2-8.1",
     [[
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(c INTEGER PRIMARY KEY, d, FOREIGN KEY(c) REFERENCES t1(a) ON UPDATE CASCADE);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
+        CREATE TABLE t2(c INTEGER PRIMARY KEY, d INT, FOREIGN KEY(c) REFERENCES t1(a) ON UPDATE CASCADE);
 
         INSERT INTO t1 VALUES(10, 100);
         INSERT INTO t2 VALUES(10, 100);
@@ -787,9 +788,9 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t2;
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a, b PRIMARY KEY);
+        CREATE TABLE t1(a INT , b TEXT PRIMARY KEY);
         CREATE TABLE t2(
-            x PRIMARY KEY REFERENCES t1 ON UPDATE RESTRICT);
+            x TEXT PRIMARY KEY REFERENCES t1 ON UPDATE RESTRICT);
         INSERT INTO t1 VALUES(1, 'one');
         INSERT INTO t1 VALUES(2, 'two');
         INSERT INTO t1 VALUES(3, 'three');
@@ -835,13 +836,13 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t2;
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(x COLLATE "unicode_ci" PRIMARY KEY);
+        CREATE TABLE t1(x  TEXT COLLATE "unicode_ci" PRIMARY KEY);
         CREATE TRIGGER tt1 AFTER DELETE ON t1
             WHEN EXISTS ( SELECT 1 FROM t2 WHERE old.x = y )
         BEGIN
             INSERT INTO t1 VALUES(old.x);
         END;
-        CREATE TABLE t2(y COLLATE "unicode_ci" PRIMARY KEY REFERENCES t1);
+        CREATE TABLE t2(y TEXT COLLATE "unicode_ci" PRIMARY KEY REFERENCES t1);
         INSERT INTO t1 VALUES('A');
         INSERT INTO t1 VALUES('B');
         INSERT INTO t2 VALUES('A');
@@ -869,7 +870,7 @@ test:do_execsql_test(
     "fkey2-9.7",
     [[
         DROP TABLE t2;
-        CREATE TABLE t2(y COLLATE "unicode_ci" PRIMARY KEY REFERENCES t1 ON DELETE RESTRICT);
+        CREATE TABLE t2(y TEXT COLLATE "unicode_ci" PRIMARY KEY REFERENCES t1 ON DELETE RESTRICT);
         INSERT INTO t2 VALUES('A');
         INSERT INTO t2 VALUES('B');
     ]], {
@@ -911,16 +912,16 @@ test:do_execsql_test(
     "fkey2-9.11",
     [[
         CREATE TABLE up(
-            c00, c01, c02, c03, c04, c05, c06, c07, c08, c09,
-            c10, c11, c12, c13, c14, c15, c16, c17, c18, c19,
-            c20, c21, c22, c23, c24, c25, c26, c27, c28, c29,
-            c30, c31, c32, c33, c34, c35, c36, c37, c38, c39,
+            c00 TEXT , c01 TEXT , c02 TEXT , c03 TEXT , c04 TEXT , c05 TEXT , c06 TEXT , c07 TEXT , c08 TEXT , c09 TEXT ,
+            c10 TEXT , c11 TEXT , c12 TEXT , c13 TEXT , c14 TEXT , c15 TEXT , c16 TEXT , c17 TEXT , c18 TEXT , c19 TEXT ,
+            c20 TEXT , c21 TEXT , c22 TEXT , c23 TEXT , c24 TEXT , c25 TEXT , c26 TEXT , c27 TEXT , c28 TEXT , c29 TEXT ,
+            c30 TEXT , c31 TEXT , c32 TEXT , c33 TEXT , c34 TEXT , c35 TEXT , c36 TEXT , c37 TEXT , c38 TEXT , c39 TEXT ,
             PRIMARY KEY(c34, c35));
         CREATE TABLE down(
-            c00, c01, c02, c03, c04, c05, c06, c07, c08, c09,
-            c10, c11, c12, c13, c14, c15, c16, c17, c18, c19,
-            c20, c21, c22, c23, c24, c25, c26, c27, c28, c29,
-            c30, c31, c32, c33, c34, c35, c36, c37, c38, c39,
+            c00 TEXT , c01 TEXT , c02 TEXT , c03 TEXT , c04 TEXT , c05 TEXT , c06 TEXT , c07 TEXT , c08 TEXT , c09 TEXT ,
+            c10 TEXT , c11 TEXT , c12 TEXT , c13 TEXT , c14 TEXT , c15 TEXT , c16 TEXT , c17 TEXT , c18 TEXT , c19 TEXT ,
+            c20 TEXT , c21 TEXT , c22 TEXT , c23 TEXT , c24 TEXT , c25 TEXT , c26 TEXT , c27 TEXT , c28 TEXT , c29 TEXT ,
+            c30 TEXT , c31 TEXT , c32 TEXT , c33 TEXT , c34 TEXT , c35 TEXT , c36 TEXT , c37 TEXT , c38 TEXT , c39 TEXT ,
             PRIMARY KEY(c39, c38),
             FOREIGN KEY(c39, c38) REFERENCES up ON UPDATE CASCADE);
         INSERT INTO up(c34, c35) VALUES('yes', 'no');
@@ -986,9 +987,9 @@ test:do_execsql_test(
 -- test:do_execsql_test(
 --     "fkey2-10.1",
 --     [[
---         CREATE TABLE t1(a PRIMARY KEY, b REFERENCES t1);
---         CREATE TABLE t2(a PRIMARY KEY, b REFERENCES t1, c REFERENCES t2);
---         CREATE TABLE t3(a PRIMARY KEY REFERENCES t1, b REFERENCES t2, c REFERENCES t1);
+--         CREATE TABLE t1(a  INT PRIMARY KEY, b  INT REFERENCES t1);
+--         CREATE TABLE t2(a  INT PRIMARY KEY, b  INT REFERENCES t1, c  INT REFERENCES t2);
+--         CREATE TABLE t3(a  INT PRIMARY KEY REFERENCES t1, b  INT REFERENCES t2, c  INT REFERENCES t1);
 --         INSERT INTO t1 VALUES(1, 1);
 --         ALTER TABLE t1 RENAME TO t4;
 --         SELECT * FROM t4;
@@ -1044,7 +1045,7 @@ test:do_catchsql_test(
     [[
         DROP TABLE IF EXISTS t2;
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a PRIMARY KEY, b REFERENCES nosuchtable);
+        CREATE TABLE t1(a INT PRIMARY KEY, b INT REFERENCES nosuchtable);
     ]], {
         -- <fkey2-10.6>
         1, "Space 'NOSUCHTABLE' does not exist"
@@ -1054,10 +1055,10 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey2-10.7",
     [[
-        CREATE TABLE t1(a PRIMARY KEY, b);
+        CREATE TABLE t1(a TEXT PRIMARY KEY, b INT );
         INSERT INTO t1 VALUES('a', 1);
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t2(x PRIMARY KEY REFERENCES t1);
+        CREATE TABLE t2(x TEXT PRIMARY KEY REFERENCES t1);
         INSERT INTO t2 VALUES('a');
     ]], {
         -- <fkey2-10.7>
@@ -1089,8 +1090,8 @@ test:do_catchsql_test(
     [[
         DROP TABLE IF EXISTS cc;
         DROP TABLE IF EXISTS pp;
-        CREATE TABLE pp(x, y, PRIMARY KEY(x, y));
-        CREATE TABLE cc(a PRIMARY KEY, b, FOREIGN KEY(a, b) REFERENCES pp(x, z));
+        CREATE TABLE pp(x TEXT, y TEXT, PRIMARY KEY(x, y));
+        CREATE TABLE cc(a  INT PRIMARY KEY, b INT , FOREIGN KEY(a, b) REFERENCES pp(x, z));
     ]], {
         -- <fkey2-10.14>
         1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_CC': foreign key refers to nonexistent field Z"
@@ -1101,14 +1102,14 @@ test:do_execsql_test(
     "fkey2-10.16",
     [[
         CREATE TABLE cc(
-            a PRIMARY KEY, b,
+            a  TEXT PRIMARY KEY, b TEXT,
             FOREIGN KEY(a, b) REFERENCES pp DEFERRABLE INITIALLY DEFERRED);
 
         INSERT INTO pp VALUES('a', 'b');
         INSERT INTO cc VALUES('a', 'b');
         DROP TABLE cc;
         DROP TABLE pp;
-        CREATE TABLE pp(a, b, c, PRIMARY KEY(b, c));
+        CREATE TABLE pp(a INT , b TEXT, c TEXT, PRIMARY KEY(b, c));
         INSERT INTO pp VALUES(1, 'a', 'b');
     ]], {
         -- <fkey2-10.16>
@@ -1127,8 +1128,8 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "fkey2-10.18",
     [[
-        CREATE TABLE b1(a PRIMARY KEY, b);
-        CREATE TABLE b2(a PRIMARY KEY, b REFERENCES b1);
+        CREATE TABLE b1(a  INT PRIMARY KEY, b INT );
+        CREATE TABLE b2(a  INT PRIMARY KEY, b  INT REFERENCES b1);
         DROP TABLE b1;
     ]], {
         -- <fkey2-10.18>
@@ -1139,7 +1140,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "fkey2-10.19",
     [[
-        CREATE TABLE b3(a PRIMARY KEY, b REFERENCES b2 DEFERRABLE INITIALLY DEFERRED);
+        CREATE TABLE b3(a  INT PRIMARY KEY, b  INT REFERENCES b2 DEFERRABLE INITIALLY DEFERRED);
         DROP TABLE b2;
     ]], {
         -- <fkey2-10.19>
@@ -1152,7 +1153,7 @@ test:do_catchsql_test(
     [[
         DROP VIEW IF EXISTS v;
         CREATE VIEW v AS SELECT * FROM b1;
-        CREATE TABLE t1(x PRIMARY KEY REFERENCES v);
+        CREATE TABLE t1(x INT PRIMARY KEY REFERENCES v);
     ]], {
         -- <fkey2-10.20>
         1, "referenced table can't be view"
@@ -1167,7 +1168,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey2-11.1",
     [[
-        CREATE TABLE self(a PRIMARY KEY, b REFERENCES self(a));
+        CREATE TABLE self(a INT PRIMARY KEY, b INT REFERENCES self(a));
         INSERT INTO self VALUES(13, 13);
         UPDATE self SET a = 14, b = 14;
     ]], {
@@ -1237,7 +1238,7 @@ test:do_execsql_test(
     "fkey2-11.8",
     [[
         DROP TABLE IF EXISTS self;
-        CREATE TABLE self(a UNIQUE, b PRIMARY KEY REFERENCES self(a));
+        CREATE TABLE self(a INT UNIQUE, b INT PRIMARY KEY REFERENCES self(a));
         INSERT INTO self VALUES(13, 13);
         UPDATE self SET a = 14, b = 14;
     ]], {
@@ -1309,11 +1310,11 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey2-12.1",
     [[
-        CREATE TABLE tdd08(a PRIMARY KEY, b);
+        CREATE TABLE tdd08(a INT PRIMARY KEY, b INT);
         CREATE UNIQUE INDEX idd08 ON tdd08(a,b);
         INSERT INTO tdd08 VALUES(200,300);
 
-        CREATE TABLE tdd08_b(w PRIMARY KEY,x,y, FOREIGN KEY(x,y) REFERENCES tdd08(a,b));
+        CREATE TABLE tdd08_b(w  INT PRIMARY KEY,x INT ,y INT , FOREIGN KEY(x,y) REFERENCES tdd08(a,b));
         INSERT INTO tdd08_b VALUES(100,200,300);
     ]], {
         -- <fkey2-12.1>
@@ -1373,10 +1374,10 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey2-13.1",
     [[
-        CREATE TABLE tce71(a PRIMARY KEY, b);
+        CREATE TABLE tce71(a INT PRIMARY KEY, b INT);
         CREATE UNIQUE INDEX ice71 ON tce71(a,b);
         INSERT INTO tce71 VALUES(100,200);
-        CREATE TABLE tce72(w PRIMARY KEY, x, y, FOREIGN KEY(x,y) REFERENCES tce71(a,b));
+        CREATE TABLE tce72(w  INT PRIMARY KEY, x INT , y INT , FOREIGN KEY(x,y) REFERENCES tce71(a,b));
         INSERT INTO tce72 VALUES(300,100,200);
         UPDATE tce71 set b = 200 where a = 100;
         SELECT * FROM tce71, tce72;
@@ -1409,9 +1410,9 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey2-14.1",
     [[
-        CREATE TABLE tce73(a PRIMARY KEY, b, UNIQUE(a,b));
+        CREATE TABLE tce73(a INTEGER PRIMARY KEY, b INT , UNIQUE(a,b));
         INSERT INTO tce73 VALUES(100,200);
-        CREATE TABLE tce74(w PRIMARY KEY, x, y, FOREIGN KEY(x,y) REFERENCES tce73(a,b));
+        CREATE TABLE tce74(w INTEGER PRIMARY KEY, x INT , y INT , FOREIGN KEY(x,y) REFERENCES tce73(a,b));
         INSERT INTO tce74 VALUES(300,100,200);
         UPDATE tce73 set b = 200 where a = 100;
         SELECT * FROM tce73, tce74;
diff --git a/test/sql-tap/fkey3.test.lua b/test/sql-tap/fkey3.test.lua
index 84997dd35..8fbbdcfbc 100755
--- a/test/sql-tap/fkey3.test.lua
+++ b/test/sql-tap/fkey3.test.lua
@@ -107,7 +107,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "fkey3-3.1",
     [[
-        CREATE TABLE t3(a PRIMARY KEY, b, c, d,
+        CREATE TABLE t3(a INT PRIMARY KEY, b INT, c INT, d INT,
             UNIQUE(a, b),
             FOREIGN KEY(c, d) REFERENCES t3(a, b));
         INSERT INTO t3 VALUES(1, 2, 1, 2);
@@ -139,7 +139,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey3-3.4",
     [[
-        CREATE TABLE t4(a PRIMARY KEY, b REFERENCES t4(a));
+        CREATE TABLE t4(a INT PRIMARY KEY, b INT REFERENCES t4(a));
     ]], {
         -- <fkey3-3.4>
         -- </fkey3-3.4>
@@ -158,7 +158,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey3-3.6",
     [[
-        CREATE TABLE t6(a PRIMARY KEY, b, c, d, UNIQUE (a, b),
+        CREATE TABLE t6(a INTEGER PRIMARY KEY, b TEXT, c INT, d TEXT, UNIQUE(a, b),
             FOREIGN KEY(c, d) REFERENCES t6(a, b));
         INSERT INTO t6 VALUES(1, 'a', 1, 'a');
         INSERT INTO t6 VALUES(2, 'a', 2, 'a');
@@ -205,7 +205,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "fkey3-3.10",
     [[
-        CREATE TABLE t7(a, b, c, d PRIMARY KEY, UNIQUE(a, b),
+        CREATE TABLE t7(a TEXT, b INT, c TEXT, d INTEGER PRIMARY KEY, UNIQUE(a, b),
             FOREIGN KEY(c, d) REFERENCES t7(a, b));
         INSERT INTO t7 VALUES('x', 1, 'x', 1);
         INSERT INTO t7 VALUES('x', 2, 'x', 2);
@@ -237,7 +237,8 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey3-6.1",
     [[
-        CREATE TABLE t8(a PRIMARY KEY, b, c, d, e);
+        CREATE TABLE t8(a INT PRIMARY KEY, b INT, c INT, d INT, e INT, UNIQUE(a, b),
+                        FOREIGN KEY(c, d) REFERENCES t8(a, b));
         CREATE UNIQUE INDEX t8i1 ON t8(a, b);
         CREATE UNIQUE INDEX t8i2 ON t8(c);
         ALTER TABLE t8 ADD CONSTRAINT fk1 FOREIGN KEY (c, d) REFERENCES t8(a, b);
@@ -271,7 +272,7 @@ test:do_catchsql_test(
     "fkey3-6.4",
     [[
         CREATE TABLE TestTable (
-            id PRIMARY KEY,
+            id INT PRIMARY KEY,
             name TEXT,
             source_id INTEGER NOT NULL,
             parent_id INTEGER);
diff --git a/test/sql-tap/fkey4.test.lua b/test/sql-tap/fkey4.test.lua
index df3548f8c..a1b3b1f41 100755
--- a/test/sql-tap/fkey4.test.lua
+++ b/test/sql-tap/fkey4.test.lua
@@ -7,8 +7,8 @@ test:plan(17)
 test:do_execsql_test(
     "fkey8-1.1",
     [[
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2);
         DELETE FROM p1 WHERE a = 2;
@@ -23,8 +23,8 @@ test:do_catchsql_test(
     [[
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON DELETE SET NULL);
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON DELETE SET NULL);
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2);
         DELETE FROM p1 WHERE a = 2;
@@ -39,8 +39,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY DEFAULT 3 REFERENCES p1 ON DELETE SET DEFAULT);
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY DEFAULT 3 REFERENCES p1 ON DELETE SET DEFAULT);
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2);
         DELETE FROM p1 WHERE a = 2;
@@ -56,16 +56,16 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
-        CREATE TRIGGER ct1 AFTER DELETE ON c1 BEGIN INSERT INTO p1 VALUES('x'); END;
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
+        CREATE TRIGGER ct1 AFTER DELETE ON c1 BEGIN INSERT INTO p1 VALUES(0); END;
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2);
         DELETE FROM p1 WHERE a = 2;
         SELECT * FROM p1;
     ]], {
         -- <fkey8-1.4>
-        1, 3, 'x'
+        0, 1, 3
         -- </fkey8-1.4>
     })
 
@@ -74,9 +74,9 @@ test:do_catchsql_test(
     [[
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
-        CREATE TABLE cc1(d PRIMARY KEY REFERENCES c1(b));
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
+        CREATE TABLE cc1(d INT PRIMARY KEY REFERENCES c1(b));
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2), (3);
         INSERT INTO cc1 VALUES (2);
@@ -93,9 +93,9 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS cc1;
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
-        CREATE TABLE cc1(d PRIMARY KEY REFERENCES c1(b) ON DELETE CASCADE);
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
+        CREATE TABLE cc1(d INT PRIMARY KEY REFERENCES c1(b) ON DELETE CASCADE);
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2), (3);
         INSERT INTO cc1 VALUES (2);
@@ -112,9 +112,9 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS cc1;
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
-        CREATE TABLE cc1(c PRIMARY KEY, d REFERENCES c1(b) ON DELETE SET NULL);
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
+        CREATE TABLE cc1(c INT PRIMARY KEY, d INT REFERENCES c1(b) ON DELETE SET NULL);
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2), (3);
         INSERT INTO cc1 VALUES (2, 2);
@@ -132,9 +132,9 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS cc1;
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
-        CREATE TABLE cc1(c PRIMARY KEY, d DEFAULT 3 REFERENCES c1(b) ON DELETE SET DEFAULT);
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON DELETE CASCADE);
+        CREATE TABLE cc1(c INT PRIMARY KEY, d INT DEFAULT 3 REFERENCES c1(b) ON DELETE SET DEFAULT);
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2), (3);
         INSERT INTO cc1 VALUES (2, 2);
@@ -152,8 +152,8 @@ test:do_catchsql_test(
         DROP TABLE IF EXISTS cc1;
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON UPDATE SET NULL, c);
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON UPDATE SET NULL, c INT);
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2, 1), (3, 2);
         UPDATE OR IGNORE p1 SET a = 4 WHERE a = 2;
@@ -168,8 +168,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY);
-        CREATE TABLE c1(b PRIMARY KEY REFERENCES p1 ON UPDATE CASCADE, c);
+        CREATE TABLE p1(a INT PRIMARY KEY);
+        CREATE TABLE c1(b INT PRIMARY KEY REFERENCES p1 ON UPDATE CASCADE, c INT);
         INSERT INTO p1 VALUES (1), (2), (3);
         INSERT INTO c1 VALUES (2, 1), (3, 2);
         UPDATE OR IGNORE p1 SET a = 4 WHERE a = 2;
@@ -185,8 +185,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS c1;
         DROP TABLE IF EXISTS p1;
-        CREATE TABLE p1(a PRIMARY KEY, b);
-        CREATE TABLE c1(x PRIMARY KEY REFERENCES p1 DEFERRABLE INITIALLY DEFERRED);
+        CREATE TABLE p1(a INT PRIMARY KEY, b TEXT);
+        CREATE TABLE c1(x INT PRIMARY KEY REFERENCES p1 DEFERRABLE INITIALLY DEFERRED);
         INSERT INTO p1 VALUES (1, 'one');
         INSERT INTO p1 VALUES (2, 'two');
         INSERT INTO c1 VALUES (1);
@@ -212,8 +212,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS c2;
         DROP TABLE IF EXISTS p2;
-        CREATE TABLE p2(a PRIMARY KEY, b);
-        CREATE TABLE c2(x PRIMARY KEY, y REFERENCES p2 DEFERRABLE INITIALLY DEFERRED);
+        CREATE TABLE p2(a INT PRIMARY KEY, b INT);
+        CREATE TABLE c2(x INT PRIMARY KEY, y INT REFERENCES p2 DEFERRABLE INITIALLY DEFERRED);
     ]], {
         -- <fkey8-3.1>
         -- </fkey8-3.1>
@@ -236,8 +236,8 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "fkey8-4.1",
     [[
-        CREATE TABLE p3(a PRIMARY KEY, b);
-        CREATE TABLE c3(x PRIMARY KEY REFERENCES p3);
+        CREATE TABLE p3(a INT PRIMARY KEY, b TEXT);
+        CREATE TABLE c3(x INT PRIMARY KEY REFERENCES p3);
         INSERT INTO p3 VALUES(1, 'one');
         INSERT INTO p3 VALUES(2, 'two');
         INSERT INTO c3 VALUES(1);
@@ -256,8 +256,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS c3;
         DROP TABLE IF EXISTS p3;
-        CREATE TABLE p3(a PRIMARY KEY, b);
-        CREATE TABLE c3(x PRIMARY KEY REFERENCES p3);
+        CREATE TABLE p3(a INT PRIMARY KEY, b TEXT);
+        CREATE TABLE c3(x INT PRIMARY KEY REFERENCES p3);
         INSERT INTO p3 VALUES(1, 'one');
         INSERT INTO p3 VALUES(2, 'two');
         INSERT INTO c3 VALUES(1);
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index 531ce39d8..393212968 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(14538)
+test:plan(14535)
 
 --!./tcltestrunner.lua
 -- 2001 September 15
@@ -38,7 +38,7 @@ test:do_test(
 test:do_execsql_test(
     "func-0.1",
     [[
-        CREATE TABLE t2(id integer primary key, a);
+        CREATE TABLE t2(id integer primary key, a INT);
         INSERT INTO t2(id,a) VALUES(1, 1);
         INSERT INTO t2(id,a) VALUES(2, NULL);
         INSERT INTO t2(id,a) VALUES(3, 345);
@@ -357,7 +357,7 @@ test:do_test(
     "func-4.1",
     function()
         test:execsql([[
-            CREATE TABLE t1(id integer primary key, a,b,c);
+            CREATE TABLE t1(id integer primary key, a INT,b REAL,c REAL);
             INSERT INTO t1(id, a,b,c) VALUES(1, 1,2,3);
             INSERT INTO t1(id, a,b,c) VALUES(2, 2,1.2345678901234,-12345.67890);
             INSERT INTO t1(id, a,b,c) VALUES(3, 3,-2,-5);
@@ -1201,7 +1201,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "func-12.5",
     [[
-        CREATE TABLE t4(id integer primary key, x);
+        CREATE TABLE t4(id integer primary key, x INT);
         INSERT INTO t4 VALUES(1, test_destructor('hello'));
         INSERT INTO t4 VALUES(2, test_destructor('world'));
         SELECT min(test_destructor(x)), max(test_destructor(x)) FROM t4;
@@ -1247,7 +1247,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "func-13.2",
     [[
-        CREATE TABLE t4(id integer primary key, a, b);
+        CREATE TABLE t4(id integer primary key, a INT, b INT);
         INSERT INTO t4 VALUES(1, 'abc', 'def');
         INSERT INTO t4 VALUES(2, 'ghi', 'jkl');
     ]], {
@@ -1452,7 +1452,7 @@ test:do_test(
     "func-16.1",
     function()
         test:execsql([[
-            CREATE TABLE tbl2(id integer primary key, a, b);
+            CREATE TABLE tbl2(id integer primary key, a INT, b INT);
         ]])
         STMT = sqlite3_prepare(DB, "INSERT INTO tbl2 VALUES(1, ?, ?)", -1, "TAIL")
         sqlite3_bind_blob(STMT, 1, "abc", 3)
@@ -1492,7 +1492,7 @@ end
 test:do_execsql_test(
     "func-18.1",
     [[
-        CREATE TABLE t5(id int primary key, x);
+        CREATE TABLE t5(id int primary key, x INT);
         INSERT INTO t5 VALUES(1, 1);
         INSERT INTO t5 VALUES(2, -99);
         INSERT INTO t5 VALUES(3, 10000);
@@ -1571,7 +1571,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "func-18.10",
     [[
-        CREATE TABLE t6(id primary key, x INTEGER);
+        CREATE TABLE t6(id INT primary key, x INTEGER);
         INSERT INTO t6 VALUES(1, 1);
         INSERT INTO t6 VALUES(2, 1<<62);
         SELECT sum(x) - ((1<<62)+1) from t6;
@@ -2421,7 +2421,7 @@ test:do_test(
     "func-28.1",
     function()
         test:execsql([[
-            CREATE TABLE t28(id primary key, x, y DEFAULT(nosuchfunc(1)));
+            CREATE TABLE t28(id INT primary key, x INT, y INT DEFAULT(nosuchfunc(1)));
         ]])
         return test:catchsql([[
             INSERT INTO t28(id, x) VALUES(1, 1);
@@ -2432,130 +2432,6 @@ test:do_test(
         -- </func-28.1>
     })
 
--- Verify that the length() and typeof() functions do not actually load
--- the content of their argument.
---
-
--- MUST_WORK_TEST cache_miss
-if 0>0 then
-test:do_test(
-    "func-29.1",
-    function()
-        test:execsql([[
-            CREATE TABLE t29(id INTEGER PRIMARY KEY, x, y);
-            INSERT INTO t29 VALUES(1, 2, 3), (2, NULL, 4), (3, 4.5, 5);
-            INSERT INTO t29 VALUES(4, randomblob(1000000), 6);
-            INSERT INTO t29 VALUES(5, 'hello', 7);
-        ]])
-        db("close")
-        sqlite3("db", "test.db")
-        sqlite3_db_status("db", "CACHE_MISS", 1)
-        return test:execsql("SELECT typeof(x), length(x), typeof(y) FROM t29 ORDER BY id")
-    end, {
-        -- <func-29.1>
-        "integer", 1, "integer", "null", "", "integer", "real", 3, "integer", "blob", 1000000, "integer", "text", 5, "integer"
-        -- </func-29.1>
-    })
-
-test:do_test(
-    "func-29.2",
-    function()
-        local x = test.lindex(sqlite3_db_status("db", "CACHE_MISS", 1), 1)
-        if (x < 5) then
-            x = 1
-        end
-        return x
-    end, {
-        -- <func-29.2>
-        1
-        -- </func-29.2>
-    })
-
-test:do_test(
-    "func-29.3",
-    function()
-        db("close")
-        sqlite3("db", "test.db")
-        sqlite3_db_status("db", "CACHE_MISS", 1)
-        return test:execsql("SELECT typeof(+x) FROM t29 ORDER BY id")
-    end, {
-        -- <func-29.3>
-        "integer", "null", "real", "blob", "text"
-        -- </func-29.3>
-    })
-
-if X(1339, "X!cmd", [=[["expr","[permutation] != \"mmap\""]]=])
- then
-    
-
-end
-test:do_test(
-    "func-29.5",
-    function()
-        db("close")
-        sqlite3("db", "test.db")
-        sqlite3_db_status("db", "CACHE_MISS", 1)
-        return test:execsql("SELECT sum(length(x)) FROM t29")
-    end, {
-        -- <func-29.5>
-        1000009
-        -- </func-29.5>
-    })
-
-test:do_test(
-    "func-29.6",
-    function()
-        x = test.lindex(sqlite3_db_status("db", "CACHE_MISS", 1), 1)
-        if (x < 5)
- then
-            x = 1
-        end
-        return x
-    end, {
-        -- <func-29.6>
-        1
-        -- </func-29.6>
-    })
-end
-
--- The OP_Column opcode has an optimization that avoids loading content
--- for fields with content-length=0 when the content offset is on an overflow
--- page.  Make sure the optimization works.
---
-test:do_execsql_test(
-    "func-29.10",
-    [[
-        CREATE TABLE t29b(a primary key,b,c,d,e,f,g,h,i);
-        INSERT INTO t29b 
-         VALUES(1, hex(randomblob(2000)), null, 0, 1, '', zeroblob(0),'x',x'01');
-        SELECT typeof(c), typeof(d), typeof(e), typeof(f),
-               typeof(g), typeof(h), typeof(i) FROM t29b;
-    ]], {
-        -- <func-29.10>
-        "null", "integer", "integer", "text", "blob", "text", "blob"
-        -- </func-29.10>
-    })
-
-test:do_execsql_test(
-    "func-29.11",
-    [[
-        SELECT length(f), length(g), length(h), length(i) FROM t29b;
-    ]], {
-        -- <func-29.11>
-        0, 0, 1, 1
-        -- </func-29.11>
-    })
-
-test:do_execsql_test(
-    "func-29.12",
-    [[
-        SELECT quote(f), quote(g), quote(h), quote(i) FROM t29b;
-    ]], {
-        -- <func-29.12>
-        "''", "X''", "'x'", "X'01'"
-        -- </func-29.12>
-    })
-
 -- EVIDENCE-OF: R-29701-50711 The unicode(X) function returns the numeric
 -- unicode code point corresponding to the first character of the string
 -- X.
diff --git a/test/sql-tap/func5.test.lua b/test/sql-tap/func5.test.lua
index 493b50552..db37a91b0 100755
--- a/test/sql-tap/func5.test.lua
+++ b/test/sql-tap/func5.test.lua
@@ -24,7 +24,7 @@ test:plan(5)
 test:do_execsql_test(
     "func5-1.1",
     [[
-        CREATE TABLE t1(x PRIMARY KEY,a,b,c);
+        CREATE TABLE t1(x INT PRIMARY KEY,a TEXT,b TEXT,c INT );
         INSERT INTO t1 VALUES(1,'ab','cd',1);
         INSERT INTO t1 VALUES(2,'gh','ef',5);
         INSERT INTO t1 VALUES(3,'pqr','fuzzy',99);
@@ -60,7 +60,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "func5-2.1",
     [[
-        CREATE TABLE t2(x PRIMARY KEY,y);
+        CREATE TABLE t2(x  INT PRIMARY KEY,y INT );
         INSERT INTO t2 VALUES(1,2),(3,4),(5,6),(7,8);
         SELECT x, y FROM t2 WHERE x+5=5+x ORDER BY +x;
     ]], {
diff --git a/test/sql-tap/gh-2360-omit-truncate-in-transaction.test.lua b/test/sql-tap/gh-2360-omit-truncate-in-transaction.test.lua
index 7bd5572a7..aa2989bdc 100755
--- a/test/sql-tap/gh-2360-omit-truncate-in-transaction.test.lua
+++ b/test/sql-tap/gh-2360-omit-truncate-in-transaction.test.lua
@@ -32,7 +32,7 @@ test:do_execsql_test(
 	"truncate-1.3",
 	[[
 		DROP TABLE IF EXISTS t1;
-		CREATE TABLE t1(id PRIMARY KEY, a, b);
+		CREATE TABLE t1(id INT PRIMARY KEY, a INT, b INT);
 		INSERT INTO t1 VALUES(1, 1, 1), (2, 1, 3), (3, 2, 3);
 		DELETE FROM t1;
 		SELECT * FROM t1;
diff --git a/test/sql-tap/gh-2723-concurrency.test.lua b/test/sql-tap/gh-2723-concurrency.test.lua
index 3f7d241c0..21912a0bf 100755
--- a/test/sql-tap/gh-2723-concurrency.test.lua
+++ b/test/sql-tap/gh-2723-concurrency.test.lua
@@ -11,7 +11,7 @@ for id = 1, N do
     fiber.create(
         function ()
             local table_name = "table2723"..id
-            box.sql.execute("create table "..table_name.."(id primary key, a integer unique, b)")
+            box.sql.execute("create table "..table_name.."(id INT primary key, a integer unique, b INT)")
             box.sql.execute("insert into "..table_name.." values(1, 2, 3)")
             box.sql.execute("insert into "..table_name.." values(3, 4, 3)")
             pcall( function() box.sql.execute("insert into "..table_name.." values(3, 4, 3)") end)
@@ -32,7 +32,7 @@ test:do_test(
     0)
 
 ch = fiber.channel(N)
-box.sql.execute("create table t1(id primary key, a integer unique, b);")
+box.sql.execute("create table t1(id INT primary key, a integer unique, b INT);")
 box.sql.execute("create index i1 on t1(b);")
 for id = 1, N do
     fiber.create(
@@ -59,7 +59,7 @@ box.sql.execute("drop table t1;")
 
 
 ch = fiber.channel(N)
-box.sql.execute("create table t1(id primary key, a integer unique, b);")
+box.sql.execute("create table t1(id INT primary key, a integer unique, b INT);")
 box.sql.execute("create index i1 on t1(b);")
 for id = 1, N*N do
     box.sql.execute(string.format("insert into t1 values(%s, %s, 3)", id, id))
diff --git a/test/sql-tap/gh-2884-forbid-rowid-syntax.test.lua b/test/sql-tap/gh-2884-forbid-rowid-syntax.test.lua
index 74d69aa17..c628510c2 100755
--- a/test/sql-tap/gh-2884-forbid-rowid-syntax.test.lua
+++ b/test/sql-tap/gh-2884-forbid-rowid-syntax.test.lua
@@ -4,7 +4,7 @@ test:plan(1)
 
 local ok = pcall(test.execsql, test, [[
     DROP TABLE IF EXISTS t1;
-    CREATE TABLE t1(a, b, c, d TEXT, PRIMARY KEY (c, d)) WITHOUT ROWID;
+    CREATE TABLE t1(a INT, b INT, c INT, d TEXT, PRIMARY KEY (c, d)) WITHOUT ROWID;
 ]])
 
 test:ok(not ok, 'rowid syntax must be forbidden')
diff --git a/test/sql-tap/gh-2996-indexed-by.test.lua b/test/sql-tap/gh-2996-indexed-by.test.lua
index 4b1dae4b4..7ee86be90 100755
--- a/test/sql-tap/gh-2996-indexed-by.test.lua
+++ b/test/sql-tap/gh-2996-indexed-by.test.lua
@@ -7,7 +7,7 @@ test:plan(13)
 -- statement is correct.
 
 test:execsql [[
-    CREATE TABLE t1(a INT PRIMARY KEY, b);
+    CREATE TABLE t1(a INT PRIMARY KEY, b INT);
     CREATE INDEX t1ix2 on t1(b);
     CREATE INDEX t1ix1 on t1(b);
 ]]
diff --git a/test/sql-tap/gh-3307-xfer-optimization-issue.test.lua b/test/sql-tap/gh-3307-xfer-optimization-issue.test.lua
index 8d9626198..80a2a2d9c 100755
--- a/test/sql-tap/gh-3307-xfer-optimization-issue.test.lua
+++ b/test/sql-tap/gh-3307-xfer-optimization-issue.test.lua
@@ -201,8 +201,8 @@ test:do_catchsql_xfer_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
+        CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT);
         INSERT INTO t1 VALUES (1, 1), (3, 3), (5, 5);
         INSERT INTO t2 VALUES (2, 2), (3, 4);
         START TRANSACTION;
@@ -236,8 +236,8 @@ test:do_catchsql_xfer_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
+        CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT);
         INSERT INTO t1 VALUES (1, 1), (3, 3), (5, 5);
         INSERT INTO t2 VALUES (2, 2), (3, 4);
         START TRANSACTION;
@@ -271,8 +271,8 @@ test:do_catchsql_xfer_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
+        CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT);
         INSERT INTO t1 VALUES (1, 1), (3, 3), (5, 5);
         START TRANSACTION;
             INSERT OR ROLLBACK INTO t2 SELECT * FROM t1;
@@ -304,8 +304,8 @@ test:do_catchsql_xfer_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
+        CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT);
         INSERT INTO t1 VALUES (1, 1), (3, 3), (5, 5);
         INSERT INTO t2 VALUES (2, 2), (3, 4);
         START TRANSACTION;
@@ -337,8 +337,8 @@ test:do_catchsql_xfer_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
+        CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT);
         INSERT INTO t1 VALUES (1, 1), (3, 3), (5, 5);
         INSERT INTO t2 VALUES (2, 2), (3, 4);
         START TRANSACTION;
@@ -372,8 +372,8 @@ test:do_catchsql_xfer_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
+        CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT);
         INSERT INTO t1 VALUES (1, 1), (3, 3), (5, 5);
         INSERT INTO t2 VALUES (2, 2), (3, 4);
         START TRANSACTION;
@@ -407,8 +407,8 @@ test:do_catchsql_xfer_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
-        CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
+        CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT);
         INSERT INTO t1 VALUES (1, 1), (3, 3), (5, 5);
         INSERT INTO t2 VALUES (2, 2), (3, 4);
         START TRANSACTION;
diff --git a/test/sql-tap/gh-3332-tuple-format-leak.test.lua b/test/sql-tap/gh-3332-tuple-format-leak.test.lua
index 05b30aa31..f19b7bc22 100755
--- a/test/sql-tap/gh-3332-tuple-format-leak.test.lua
+++ b/test/sql-tap/gh-3332-tuple-format-leak.test.lua
@@ -5,7 +5,7 @@ test:plan(2)
 test:do_test(
     "format-leak-prep",
     function()
-        box.sql.execute("CREATE TABLE t1(id UNSIGNED BIG INT PRIMARY KEY,\
+        box.sql.execute("CREATE TABLE t1(id INTEGER PRIMARY KEY,\
                          max_players INTEGER, n_players INTEGER, flags INTEGER);");
         box.sql.execute("CREATE INDEX IDX_MAX_PLAYERS ON t1(max_players);");
         box.sql.execute("CREATE INDEX IDX_N_PLAYERS ON t1(n_players);");
diff --git a/test/sql-tap/gh2130-index-refer-table.test.lua b/test/sql-tap/gh2130-index-refer-table.test.lua
index b5fc1106d..b3bf519ae 100755
--- a/test/sql-tap/gh2130-index-refer-table.test.lua
+++ b/test/sql-tap/gh2130-index-refer-table.test.lua
@@ -5,8 +5,8 @@ test:plan(5)
 test:execsql " DROP TABLE IF EXISTS t1 "
 test:execsql " DROP TABLE IF EXISTS t2 "
 
-test:execsql " CREATE TABLE t1(a INT PRIMARY KEY, b, c) "
-test:execsql " CREATE TABLE t2(a INT PRIMARY KEY, b, c) "
+test:execsql " CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT) "
+test:execsql " CREATE TABLE t2(a INT PRIMARY KEY, b INT, c INT) "
 
 test:do_execsql_test(
 	"index-1.1",
diff --git a/test/sql-tap/hexlit.test.lua b/test/sql-tap/hexlit.test.lua
index c037e7174..158eda73b 100755
--- a/test/sql-tap/hexlit.test.lua
+++ b/test/sql-tap/hexlit.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(130)
+test:plan(128)
 
 --!./tcltestrunner.lua
 -- 2014-07-23
@@ -98,29 +98,6 @@ for n = 1, 0x10 -1, 1 do
     hexlit1("200."..n..".3", "0X"..string.format("%03X",n), n)
     hexlit1("200."..n..".4", "0x"..string.format("%03X",n), n)
 end
--- String literals that look like hex do not get cast or coerced.
---
-test:do_execsql_test(
-    "hexlit-300",
-    [[
-        CREATE TABLE t1(id primary key, x INT, y REAL);
-        INSERT INTO t1 VALUES(1, '1234','4567'),(2, '0x1234','0x4567');
-        SELECT typeof(x), x, typeof(y), y, '#' FROM t1 ORDER BY id;
-    ]], {
-        -- <hexlit-300>
-        "integer", 1234, "real", 4567.0, "#", "text", "0x1234", "text", "0x4567", "#"
-        -- </hexlit-300>
-    })
-
-test:do_execsql_test(
-    "hexlit-301",
-    [[
-        SELECT CAST('0x1234' AS INTEGER);
-    ]], {
-        -- <hexlit-301>
-        0
-        -- </hexlit-301>
-    })
 
 -- Oversized hex literals are rejected
 --
@@ -138,7 +115,7 @@ test:do_catchsql_test(
     "hexlist-410",
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(x primary key);
+        CREATE TABLE t1(x INT primary key);
         INSERT INTO t1 VALUES(1+0x10000000000000000);
     ]], {
         -- <hexlist-410>
diff --git a/test/sql-tap/icu.test.lua b/test/sql-tap/icu.test.lua
index 5b67e9fe7..b9026d22e 100755
--- a/test/sql-tap/icu.test.lua
+++ b/test/sql-tap/icu.test.lua
@@ -25,7 +25,7 @@ if (0 > 0)
  then
     -- Create a table to work with.
     --
-    test:execsql "CREATE TABLE test1(i1 int primary key, i2 int, r1 real, r2 real, t1 text, t2 text)"
+    test:execsql "CREATE TABLE test1(i1 int primary key, i2 int, r1 INT real, r2 INT real, t1 text, t2 text)"
     test:execsql "INSERT INTO test1 VALUES(1,2,1.1,2.2,'hello','world')"
     local function test_expr(name, settings, expr, result)
         test:do_test(
@@ -87,7 +87,7 @@ if (0 > 0)
     test:do_execsql_test(
         "icu-4.1",
         [[
-            CREATE TABLE fruit(name);
+            CREATE TABLE fruit(name INT);
             INSERT INTO fruit VALUES('plum');
             INSERT INTO fruit VALUES('cherry');
             INSERT INTO fruit VALUES('apricot');
diff --git a/test/sql-tap/identifier-characters.test.lua b/test/sql-tap/identifier-characters.test.lua
index 988d44880..94fadc05d 100755
--- a/test/sql-tap/identifier-characters.test.lua
+++ b/test/sql-tap/identifier-characters.test.lua
@@ -14,7 +14,7 @@ local testcases = {
 		if string.len(id) == box.schema.NAME_MAX then
 			id = string.sub(id, string.len(id))
 		end
-		test:execsql(string.format("create table \"%s\" (a primary key);", id))
+		test:execsql(string.format("create table \"%s\" (a INT primary key);", id))
 	end,
 	-- cleanup
 	function (id)
@@ -25,7 +25,7 @@ local testcases = {
 	end},
 	{"column name",
 	function (id)
-		test:execsql(string.format("create table table1(a primary key, \"%s\");", id))
+		test:execsql(string.format("create table table1(a INT primary key, \"%s\" INT);", id))
 	end,
 	function (id)
 		test:execsql(string.format("drop table table1;", id))
@@ -81,7 +81,7 @@ local testcases = {
 
 test:do_execsql_test(
 	test_prefix.."preparition",
-	"create table test(a primary key, b, c)")
+	"create table test(a  INT primary key, b INT, c INT)")
 
 for _, testcase in ipairs(testcases) do
 	test:do_test(
diff --git a/test/sql-tap/identifier_case.test.lua b/test/sql-tap/identifier_case.test.lua
index ed9553c6b..096130a52 100755
--- a/test/sql-tap/identifier_case.test.lua
+++ b/test/sql-tap/identifier_case.test.lua
@@ -82,7 +82,7 @@ for _, row in ipairs(data) do
     test:do_catchsql_test(
         test_prefix.."2.1."..row[1],
         string.format( [[
-                CREATE TABLE table%s ("columNN", %s, primary key("columNN", %s));
+                CREATE TABLE table%s ("columNN" INT, %s INT, primary key("columNN", %s));
                 INSERT INTO table%s(%s, "columNN") values (%s, %s);
                 ]],
                 row[1], row[2], row[2],
@@ -116,7 +116,7 @@ test:do_test(
     end,
     6)
 
-test:execsql([[create table table1(columnn, "columnn" primary key)]])
+test:execsql([[create table table1(columnn INT , "columnn" INT primary key)]])
 test:execsql([[insert into table1("columnn", "COLUMNN") values(2,1)]])
 
 
@@ -158,7 +158,7 @@ test:do_test(
 
 test:do_execsql_test(
     test_prefix.."4.0",
-    string.format([[create table table1(a, b primary key)]]),
+    string.format([[create table table1(a INT , b  INT primary key)]]),
     nil
 )
 
@@ -213,7 +213,7 @@ data = {
 test:do_catchsql_test(
     test_prefix.."6.0.",
     [[
-        CREATE TABLE T1 (a primary key, b);
+        CREATE TABLE T1 (a TEXT primary key, b TEXT);
     ]],
     {0})
 
diff --git a/test/sql-tap/in1.test.lua b/test/sql-tap/in1.test.lua
index e81f142f8..b938ff17f 100755
--- a/test/sql-tap/in1.test.lua
+++ b/test/sql-tap/in1.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(83)
+test:plan(80)
 
 --!./tcltestrunner.lua
 -- 2001 September 15
@@ -25,7 +25,7 @@ test:do_test(
     "in-1.0",
     function()
         test:execsql [[
-            CREATE TABLE t1(a PRIMARY KEY, b);
+            CREATE TABLE t1(a  INT PRIMARY KEY, b INT );
             START TRANSACTION;
         ]]
         -- for _ in X(0, "X!for", [=[["set i 1","$i<=10","incr i"]]=]) do
@@ -309,16 +309,16 @@ test:do_test(
 test:do_execsql_test(
     "in-5.1",
     [[
-        INSERT INTO t1 VALUES('hello', 'world');
+        INSERT INTO t1 VALUES(19, 21);
         SELECT * FROM t1
         WHERE a IN (
-           'Do','an','IN','with','a','constant','RHS','but','where','the',
-           'has','many','elements','We','need','to','test','that',
-           'collisions','hash','table','are','resolved','properly',
-           'This','in-set','contains','thirty','one','entries','hello');
+           100,104,1092,1234,19,456,544,324,476,632,
+           231,987,79879,657,546,33,555432,44433,
+           234,3453,633,12341,5675,67854,
+           12123,345,3453,5553,3241,56751,9845);
     ]], {
         -- <in-5.1>
-        "hello", "world"
+        19, 21
         -- </in-5.1>
     })
 
@@ -327,15 +327,14 @@ test:do_execsql_test(
 test:do_execsql_test(
     "in-6.1",
     [[
-        CREATE TABLE ta(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE ta(a INTEGER PRIMARY KEY, b INT );
         INSERT INTO ta VALUES(1,1);
         INSERT INTO ta VALUES(2,2);
         INSERT INTO ta VALUES(3,3);
         INSERT INTO ta VALUES(4,4);
         INSERT INTO ta VALUES(6,6);
         INSERT INTO ta VALUES(8,8);
-        INSERT INTO ta VALUES(10,
-           'This is a key that is long enough to require a malloc in the VDBE');
+        INSERT INTO ta VALUES(10, 10);
         SELECT * FROM ta WHERE a<10;
     ]], {
         -- <in-6.1>
@@ -346,15 +345,14 @@ test:do_execsql_test(
 test:do_execsql_test(
     "in-6.2",
     [[
-        CREATE TABLE tb(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE tb(a INTEGER PRIMARY KEY, b INT );
         INSERT INTO tb VALUES(1,1);
         INSERT INTO tb VALUES(2,2);
         INSERT INTO tb VALUES(3,3);
         INSERT INTO tb VALUES(5,5);
         INSERT INTO tb VALUES(7,7);
         INSERT INTO tb VALUES(9,9);
-        INSERT INTO tb VALUES(11,
-           'This is a key that is long enough to require a malloc in the VDBE');
+        INSERT INTO tb VALUES(11,10);
         SELECT * FROM tb WHERE a<10;
     ]], {
         -- <in-6.2>
@@ -428,7 +426,7 @@ test:do_execsql_test(
         SELECT a FROM ta WHERE a IN (SELECT b FROM tb);
     ]], {
         -- <in-6.9>
-        1, 2, 3
+        1, 2, 3, 10
         -- </in-6.9>
     })
 
@@ -438,7 +436,7 @@ test:do_execsql_test(
         SELECT a FROM ta WHERE a NOT IN (SELECT b FROM tb);
     ]], {
         -- <in-6.10>
-        4, 6, 8, 10
+        4, 6, 8
         -- </in-6.10>
     })
 
@@ -470,7 +468,7 @@ test:do_execsql_test(
         SELECT a FROM t1 WHERE a NOT IN () ORDER BY a;
     ]], {
         -- <in-7.3>
-        5, 6, 7, 8, "hello"
+        5, 6, 7, 8, 19
         -- </in-7.3>
     })
 
@@ -549,10 +547,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "in-8.1",
     [[
-        SELECT b FROM t1 WHERE a IN ('hello','there')
+        SELECT b FROM t1 WHERE a IN (19,88)
     ]], {
         -- <in-8.1>
-        "world"
+        21
         -- </in-8.1>
     })
 
@@ -586,7 +584,7 @@ test:do_execsql_test(
         SELECT b FROM t1 WHERE a NOT IN t4;
     ]], {
         -- <in-9.3>
-        64, 256, "world"
+        64, 256, 21
         -- </in-9.3>
     })
 
@@ -625,7 +623,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "in-11.1",
     [[
-        CREATE TABLE t6(a PRIMARY KEY,b NUMERIC);
+        CREATE TABLE t6(a  INT PRIMARY KEY,b NUMERIC);
         INSERT INTO t6 VALUES(1,2);
         INSERT INTO t6 VALUES(2,3);
         SELECT * FROM t6 WHERE b IN (2);
@@ -648,32 +646,6 @@ test:do_test(
         -- </in-11.2>
     })
 
-test:do_test(
-    "in-11.3",
-    function()
-        -- No coercion should occur here because of the unary + before b.
-        return test:execsql [[
-            SELECT * FROM t6 WHERE +b IN ('2');
-        ]]
-    end, {
-        -- <in-11.3>
-        
-        -- </in-11.3>
-    })
-
-test:do_test(
-    "in-11.4",
-    function()
-        -- No coercion because column a as affinity NONE
-        return test:execsql [[
-            SELECT * FROM t6 WHERE a IN ('2');
-        ]]
-    end, {
-        -- <in-11.4>
-        
-        -- </in-11.4>
-    })
-
 test:do_execsql_test(
     "in-11.5",
     [[
@@ -684,26 +656,13 @@ test:do_execsql_test(
         -- </in-11.5>
     })
 
-test:do_test(
-    "in-11.6",
-    function()
-        -- No coercion because column a as affinity NONE
-        return test:execsql [[
-            SELECT * FROM t6 WHERE +a IN ('2');
-        ]]
-    end, {
-        -- <in-11.6>
-        
-        -- </in-11.6>
-    })
-
 -- Test error conditions with expressions of the form IN(<compound select>).
 --
 test:do_execsql_test(
     "in-12.1",
     [[
-        CREATE TABLE t2(a PRIMARY KEY, b, c);
-        CREATE TABLE t3(a PRIMARY KEY, b, c);
+        CREATE TABLE t2(a  INT PRIMARY KEY, b INT , c INT );
+        CREATE TABLE t3(a  INT PRIMARY KEY, b INT , c INT );
     ]], {
         -- <in-12.1>
         
@@ -913,7 +872,7 @@ test:do_test(
 test:do_execsql_test(
     "in-13.2",
     [[
-        CREATE TABLE t7(id primary key, a, b, c NOT NULL);
+        CREATE TABLE t7(id  INT primary key, a INT , b INT , c  INT NOT NULL);
         INSERT INTO t7 VALUES(1, 1,    1, 1);
         INSERT INTO t7 VALUES(2, 2,    2, 2);
         INSERT INTO t7 VALUES(3, 3,    3, 3);
diff --git a/test/sql-tap/in2.test.lua b/test/sql-tap/in2.test.lua
index 239585eb0..9d9a3c3b3 100755
--- a/test/sql-tap/in2.test.lua
+++ b/test/sql-tap/in2.test.lua
@@ -22,7 +22,7 @@ test:plan(1999)
 test:do_execsql_test(
     "in2-1",
     [[
-        CREATE TABLE a(i INTEGER PRIMARY KEY, a);
+        CREATE TABLE a(i INTEGER PRIMARY KEY, a INT);
     ]], {
         -- <in2-1>
         
diff --git a/test/sql-tap/in3.test.lua b/test/sql-tap/in3.test.lua
index fd120451b..78f2ba4f0 100755
--- a/test/sql-tap/in3.test.lua
+++ b/test/sql-tap/in3.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(27)
+test:plan(26)
 
 --!./tcltestrunner.lua
 -- 2007 November 29
@@ -58,7 +58,7 @@ end
 test:do_execsql_test(
     "in3-1.1",
     [[
-        CREATE TABLE t1(a PRIMARY KEY, b);
+        CREATE TABLE t1(a  INT PRIMARY KEY, b INT );
         INSERT INTO t1 VALUES(1, 2);
         INSERT INTO t1 VALUES(3, 4);
         INSERT INTO t1 VALUES(5, 6);
@@ -271,18 +271,18 @@ test:do_test(
             DROP TABLE IF EXISTS t1;
             DROP TABLE IF EXISTS t1;
 
-            CREATE TABLE t1(id primary key, a BLOB, b NUMBER ,c TEXT);
+            CREATE TABLE t1(id  INT primary key, a BLOB, b NUMERIC ,c TEXT);
             CREATE UNIQUE INDEX t1_i1 ON t1(a);        /* no affinity */
             CREATE UNIQUE INDEX t1_i2 ON t1(b);        /* numeric affinity */
             CREATE UNIQUE INDEX t1_i3 ON t1(c);        /* text affinity */
 
-            CREATE TABLE t2(id primary key, x BLOB, y NUMBER, z TEXT);
+            CREATE TABLE t2(id  INT primary key, x BLOB, y NUMERIC, z TEXT);
             CREATE UNIQUE INDEX t2_i1 ON t2(x);        /* no affinity */
             CREATE UNIQUE INDEX t2_i2 ON t2(y);        /* numeric affinity */
             CREATE UNIQUE INDEX t2_i3 ON t2(z);        /* text affinity */
 
-            INSERT INTO t1 VALUES(1, 1, 1, 1);
-            INSERT INTO t2 VALUES(1, '1', '1', '1');
+            INSERT INTO t1 VALUES(1, '1', 1, '1');
+            INSERT INTO t2 VALUES(1, '1', 1, '1');
         ]]
     end, {
         -- <in3-3.1>
@@ -298,7 +298,7 @@ test:do_test(
         return exec_neph(" SELECT x IN (SELECT a FROM t1) FROM t2 ")
     end, {
         -- <in3-3.2>
-        0, 0
+        0, 1
         -- </in3-3.2>
     })
 
@@ -314,7 +314,7 @@ test:do_test(
         -- </in3-3.3>
     })
 
-test:do_test(
+--[[test:do_test(
     "in3-3.4",
     function()
         -- No affinity is applied before the comparison takes place. Making
@@ -324,7 +324,7 @@ test:do_test(
         -- <in3-3.4>
         0, 1
         -- </in3-3.4>
-    })
+    })]]
 
 test:do_test(
     "in3-3.5",
@@ -370,7 +370,7 @@ test:do_test(
     "in3-4.1",
     function()
         test:execsql [[
-            CREATE TABLE t3(a PRIMARY KEY, b, c);
+            CREATE TABLE t3(a  INT PRIMARY KEY, b TEXT , c INT );
             CREATE UNIQUE INDEX t3_i ON t3(b, a);
         ]]
         return test:execsql [[
@@ -388,7 +388,7 @@ test:do_test(
 test:do_test(
     "in3-4.2",
     function()
-        return exec_neph(" SELECT 'text' IN (SELECT b FROM t3) ")
+        return exec_neph(" SELECT 'text' IN (SELECT b FROM t3)")
     end, {
         -- <in3-4.2>
         0, 1
diff --git a/test/sql-tap/in4.test.lua b/test/sql-tap/in4.test.lua
index ac39c5fca..70fb207fd 100755
--- a/test/sql-tap/in4.test.lua
+++ b/test/sql-tap/in4.test.lua
@@ -20,7 +20,7 @@ test:plan(61)
 test:do_execsql_test(
     "in4-1.1",
     [[
-        CREATE TABLE t1(a, b PRIMARY KEY);
+        CREATE TABLE t1(a TEXT , b  INT PRIMARY KEY);
         CREATE INDEX i1 ON t1(a);
     ]], {
         -- <in4-1.1>
@@ -172,8 +172,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t1(pk primary key, x, id);
-        CREATE TABLE t2(pk primary key, x, id);
+        CREATE TABLE t1(pk  INT primary key, x INT , id INT );
+        CREATE TABLE t2(pk  INT primary key, x INT , id INT );
         INSERT INTO t1 VALUES(1, NULL, NULL);
         INSERT INTO t1 VALUES(2, 0, NULL);
         INSERT INTO t1 VALUES(3, 1, 3);
@@ -204,7 +204,7 @@ test:do_test(
     "in4-3.3",
     function()
         test:execsql [[
-            CREATE TABLE t3(x PRIMARY KEY, y, z);
+            CREATE TABLE t3(x  INT PRIMARY KEY, y INT , z INT );
             CREATE INDEX t3i1 ON t3(x, y);
             INSERT INTO t3 VALUES(1, 1, 1);
             INSERT INTO t3 VALUES(10, 10, 10);
@@ -524,7 +524,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "in4-4.1",
     [[
-        CREATE TABLE t4a(a TEXT, b TEXT COLLATE "unicode_ci", c PRIMARY KEY);
+        CREATE TABLE t4a(a TEXT, b TEXT COLLATE "unicode_ci", c  INT PRIMARY KEY);
         INSERT INTO t4a VALUES('ABC','abc',1);
         INSERT INTO t4a VALUES('def','xyz',2);
         INSERT INTO t4a VALUES('ghi','ghi',3);
@@ -588,7 +588,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "in4-4.11",
     [[
-        CREATE TABLE t4b(a TEXT, b NUMERIC, c PRIMARY KEY);
+        CREATE TABLE t4b(a TEXT, b NUMERIC, c  INT PRIMARY KEY);
         INSERT INTO t4b VALUES('1.0',1,4);
         SELECT c FROM t4b WHERE a=b;
     ]], {
@@ -623,7 +623,7 @@ test:do_execsql_test(
         SELECT c FROM t4b WHERE a=+b;
     ]], {
         -- <in4-4.14>
-        
+        4
         -- </in4-4.14>
     })
 
@@ -633,7 +633,7 @@ test:do_execsql_test(
         SELECT c FROM t4b WHERE +b=a;
     ]], {
         -- <in4-4.15>
-        
+        4
         -- </in4-4.15>
     })
 
@@ -653,7 +653,7 @@ test:do_execsql_test(
         SELECT c FROM t4b WHERE a IN (b);
     ]], {
         -- <in4-4.17>
-        
+        4
         -- </in4-4.17>
     })
 
@@ -701,9 +701,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "in4-6.1",
     [[
-        CREATE TABLE t6a(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t6a(a INTEGER PRIMARY KEY, b INT );
         INSERT INTO t6a VALUES(1,2),(3,4),(5,6);
-        CREATE TABLE t6b(c INTEGER PRIMARY KEY, d);
+        CREATE TABLE t6b(c INTEGER PRIMARY KEY, d INT );
         INSERT INTO t6b VALUES(4,44),(5,55),(6,66);
 
         SELECT * FROM t6a, t6b WHERE a=3 AND b IN (c);
diff --git a/test/sql-tap/in5.test.lua b/test/sql-tap/in5.test.lua
index 5a115ddd4..4e2cdcd24 100755
--- a/test/sql-tap/in5.test.lua
+++ b/test/sql-tap/in5.test.lua
@@ -269,7 +269,7 @@ test:do_test(
 test:do_execsql_test(
     "6.1.1",
     [[
-        CREATE TABLE t1(id primary key, a COLLATE "unicode_ci");
+        CREATE TABLE t1(id  INT primary key, a  TEXT COLLATE "unicode_ci");
         INSERT INTO t1 VALUES(1, 'one');
         INSERT INTO t1 VALUES(2, 'ONE');
     ]])
@@ -287,7 +287,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "6.2.1",
     [[
-        CREATE TABLE t3(a, b PRIMARY KEY);
+        CREATE TABLE t3(a INT , b  INT PRIMARY KEY);
         INSERT INTO t3 VALUES(1, 1);
         INSERT INTO t3 VALUES(1, 2);
         INSERT INTO t3 VALUES(1, 3);
@@ -322,8 +322,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "6.3.1",
     [[
-        CREATE TABLE x1(pk primary key, a);
-        CREATE TABLE x2(pk primary key, b);
+        CREATE TABLE x1(pk  INT primary key, a INT );
+        CREATE TABLE x2(pk  INT primary key, b INT );
         INSERT INTO x1 VALUES(1, 1), (2, 1), (3, 2);
         INSERT INTO x2 VALUES(1, 1), (2, 2);
         SELECT count(*) FROM x2 WHERE b IN (SELECT DISTINCT a FROM x1 LIMIT 2);
diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
index 50f4131cb..d84e91359 100755
--- a/test/sql-tap/index1.test.lua
+++ b/test/sql-tap/index1.test.lua
@@ -24,7 +24,7 @@ test:plan(70)
 test:do_test(
     "index-1.1",
     function()
-        test:execsql "CREATE TABLE test1(id primary key, f1 int, f2 int, f3 int)"
+        test:execsql "CREATE TABLE test1(id  INT primary key, f1 int, f2 int, f3 int)"
         test:execsql "CREATE INDEX index1 ON test1(f1)"
         return test:execsql [[SELECT "name" FROM "_space" WHERE "name"='TEST1']]
     end, {
@@ -93,7 +93,7 @@ test:do_catchsql_test(
 test:do_test(
     "index-2.1b",
     function()
-        test:execsql "CREATE TABLE test1(id primary key, f1 int, f2 int, f3 int)"
+        test:execsql "CREATE TABLE test1(id  INT primary key, f1 int, f2 int, f3 int)"
         return test:catchsql "CREATE INDEX index1 ON test1(f4)"
     end, {
         -- <index-2.1b>
@@ -122,7 +122,7 @@ test:do_test(
 test:do_test(
     "index-4.1",
     function()
-        test:execsql "CREATE TABLE test1(id primary key, cnt int, power int)"
+        test:execsql "CREATE TABLE test1(id  INT primary key, cnt int, power int)"
         local val = 2
         for i = 1, 19, 1 do
             test:execsql(string.format("INSERT INTO test1 VALUES(%s, %s,%s)", i, i, val))
@@ -278,8 +278,8 @@ test:do_test(
 test:do_test(
     "index-6.1",
     function()
-        test:execsql "CREATE TABLE test1(id primary key, f1 int, f2 int)"
-        test:execsql "CREATE TABLE test2(id primary key, g1 real, g2 real)"
+        test:execsql "CREATE TABLE test1(id  INT primary key, f1 int, f2 int)"
+        test:execsql "CREATE TABLE test2(id  INT primary key, g1 float, g2 float)"
         return test:execsql "CREATE INDEX index1 ON test1(f1)"
     end, {
         -- <index-6.1>
@@ -339,7 +339,7 @@ test:do_test(
 test:do_execsql_test(
     "index-6.4",
     [[
-        CREATE TABLE test1(id primary key, a,b);
+        CREATE TABLE test1(id  INT primary key, a INT ,b INT );
         CREATE INDEX index1 ON test1(a);
         CREATE INDEX index2 ON test1(b);
         CREATE INDEX index3 ON test1(a,b);
@@ -423,7 +423,7 @@ test:execsql("DROP TABLE IF EXISTS test1")
 test:do_test(
     "index-9.1",
     function()
-        test:execsql "CREATE TABLE tab1(id primary key, a int)"
+        test:execsql "CREATE TABLE tab1(id  INT primary key, a int)"
         test:execsql "EXPLAIN CREATE INDEX idx1 ON tab1(a)"
 
 
@@ -451,7 +451,7 @@ test:do_test(
 test:do_execsql_test(
     "index-10.0",
     [[
-        CREATE TABLE t1(id primary key, a int, b int);
+        CREATE TABLE t1(id  INT primary key, a int, b int);
         CREATE INDEX i1 ON t1(a);
         INSERT INTO t1 VALUES(1, 1,2);
         INSERT INTO t1 VALUES(2, 2,4);
@@ -605,10 +605,9 @@ end
 test:do_execsql_test(
     "index-12.1",
     [[
-        CREATE TABLE t4(id primary key, a NUM,b);
+        CREATE TABLE t4(id  INT primary key, a NUM,b INT );
         INSERT INTO t4 VALUES(1, '0.0',1);
         INSERT INTO t4 VALUES(2, '0.00',2);
-        INSERT INTO t4 VALUES(3, 'abc',3);
         INSERT INTO t4 VALUES(4, '-1.0',4);
         INSERT INTO t4 VALUES(5, '+1.0',5);
         INSERT INTO t4 VALUES(6, '0',6);
@@ -616,7 +615,7 @@ test:do_execsql_test(
         SELECT a FROM t4 ORDER BY b;
     ]], {
         -- <index-12.1>
-        0, 0, "abc", -1, 1, 0, 0
+        0, 0, -1, 1, 0, 0
         -- </index-12.1>
     })
 
@@ -646,7 +645,7 @@ test:do_execsql_test(
         SELECT a FROM t4 WHERE a>-0.5 ORDER BY b
     ]], {
         -- <index-12.4>
-        0, 0, "abc", 1, 0, 0
+        0, 0, 1, 0, 0
         -- </index-12.4>
     })
 
@@ -677,7 +676,7 @@ test:do_execsql_test(
         SELECT a FROM t4 WHERE a>-0.5 ORDER BY b
     ]], {
         -- <index-12.7>
-        0, 0, "abc", 1, 0, 0
+        0, 0, 1, 0, 0
         -- </index-12.7>
     })
 
@@ -690,7 +689,7 @@ test:do_execsql_test(
         CREATE TABLE t5(
            a int UNIQUE,
            b float PRIMARY KEY,
-           c varchar(10),
+           c  TEXT,
            UNIQUE(a,c)
         );
         INSERT INTO t5 VALUES(1,2,3);
@@ -726,17 +725,17 @@ test:do_execsql_test(
 test:do_execsql_test(
     "index-14.1",
     [[
-        CREATE TABLE t6(id primary key, a,b,c);
+        CREATE TABLE t6(id  INT primary key, a TEXT,b TEXT ,c INT );
         CREATE INDEX t6i1 ON t6(a,b);
         INSERT INTO t6 VALUES(1, '','',1);
         INSERT INTO t6 VALUES(2, '',NULL,2);
         INSERT INTO t6 VALUES(3, NULL,'',3);
-        INSERT INTO t6 VALUES(4, 'abc',123,4);
-        INSERT INTO t6 VALUES(5, 123,'abc',5);
+        INSERT INTO t6 VALUES(4, 'abc','123',4);
+        INSERT INTO t6 VALUES(5, '123','abc',5);
         SELECT c FROM t6 ORDER BY a,b;
     ]], {
         -- <index-14.1>
-        3, 5, 2, 1, 4
+       3, 2, 1, 5, 4 
         -- </index-14.1>
     })
 
@@ -766,7 +765,7 @@ test:do_execsql_test(
         SELECT c FROM t6 WHERE a>'';
     ]], {
         -- <index-14.4>
-        4
+        5, 4
         -- </index-14.4>
     })
 
@@ -776,27 +775,27 @@ test:do_execsql_test(
         SELECT c FROM t6 WHERE a>='';
     ]], {
         -- <index-14.5>
-        2, 1, 4
+        2, 1, 5, 4
         -- </index-14.5>
     })
 
-test:do_execsql_test(
+test:do_catchsql_test(
     "index-14.6",
     [[
         SELECT c FROM t6 WHERE a>123;
     ]], {
         -- <index-14.6>
-        2, 1, 4
+        1, "Can't convert to numeric "
         -- </index-14.6>
     })
 
-test:do_execsql_test(
+test:do_catchsql_test(
     "index-14.7",
     [[
         SELECT c FROM t6 WHERE a>=123;
     ]], {
         -- <index-14.7>
-        5, 2, 1, 4
+        1, "Can't convert to numeric "
         -- </index-14.7>
     })
 
@@ -806,7 +805,7 @@ test:do_execsql_test(
         SELECT c FROM t6 WHERE a<'abc';
     ]], {
         -- <index-14.8>
-        5, 2, 1
+        2, 1, 5
         -- </index-14.8>
     })
 
@@ -816,7 +815,7 @@ test:do_execsql_test(
         SELECT c FROM t6 WHERE a<='abc';
     ]], {
         -- <index-14.9>
-        5, 2, 1, 4
+        2, 1, 5, 4
         -- </index-14.9>
     })
 
@@ -826,7 +825,7 @@ test:do_execsql_test(
         SELECT c FROM t6 WHERE a<='';
     ]], {
         -- <index-14.10>
-        5, 2, 1
+        2, 1
         -- </index-14.10>
     })
 
@@ -836,7 +835,7 @@ test:do_execsql_test(
         SELECT c FROM t6 WHERE a<'';
     ]], {
         -- <index-14.11>
-        5
+        
         -- </index-14.11>
     })
 
@@ -874,7 +873,7 @@ test:do_execsql_test(
 -- } {13 14 15 12 8 5 2 1 3 6 10 11 9 4 7}
 -- # do_test index-15.3 {
 --   execsql {
---     SELECT b FROM t1 WHERE typeof(a) IN ('integer','real') ORDER BY b;
+--     SELECT b FROM t1 WHERE typeof(a) IN ('integer','float') ORDER BY b;
 --   }
 -- } {1 2 3 5 6 8 10 11 12 13 14 15}
 -- integrity_check index-15.4
@@ -882,12 +881,12 @@ test:do_execsql_test(
 -- includes qualifications that specify the same constraint twice only a
 -- single index is generated to enforce the constraint.
 --
--- For example: "CREATE TABLE abc( x PRIMARY KEY, UNIQUE(x) );"
+-- For example: "CREATE TABLE abc( x  INT PRIMARY KEY, UNIQUE(x) );"
 --
 test:do_execsql_test(
     "index-16.1",
     [[
-        CREATE TABLE t7(c UNIQUE PRIMARY KEY);
+        CREATE TABLE t7(c  INT PRIMARY KEY);
         SELECT count(*) FROM "_index" JOIN "_space" WHERE "_index"."id" = "_space"."id" AND "_space"."name"='T7';
     ]], {
         -- <index-16.1>
@@ -899,7 +898,7 @@ test:do_execsql_test(
     "index-16.2",
     [[
         DROP TABLE t7;
-        CREATE TABLE t7(c UNIQUE PRIMARY KEY);
+        CREATE TABLE t7(c  INT UNIQUE PRIMARY KEY);
         SELECT count(*) FROM "_index" JOIN "_space" WHERE "_index"."id" = "_space"."id" AND "_space"."name"='T7';
     ]], {
         -- <index-16.2>
@@ -911,7 +910,7 @@ test:do_execsql_test(
     "index-16.3",
     [[
         DROP TABLE t7;
-        CREATE TABLE t7(c PRIMARY KEY, UNIQUE(c) );
+        CREATE TABLE t7(c  INT PRIMARY KEY, UNIQUE(c) );
         SELECT count(*) FROM "_index" JOIN "_space" WHERE "_index"."id" = "_space"."id" AND "_space"."name"='T7';
     ]], {
         -- <index-16.3>
@@ -923,7 +922,7 @@ test:do_execsql_test(
     "index-16.4",
     [[
         DROP TABLE t7;
-        CREATE TABLE t7(c, d , UNIQUE(c, d), PRIMARY KEY(c, d) );
+        CREATE TABLE t7(c INT , d  INT , UNIQUE(c, d), PRIMARY KEY(c, d) );
         SELECT count(*) FROM "_index" JOIN "_space" WHERE "_index"."id" = "_space"."id" AND "_space"."name"='T7';
     ]], {
         -- <index-16.4>
@@ -935,7 +934,7 @@ test:do_execsql_test(
     "index-16.5",
     [[
         DROP TABLE t7;
-        CREATE TABLE t7(c, d , UNIQUE(c), PRIMARY KEY(c, d) );
+        CREATE TABLE t7(c INT , d  INT , UNIQUE(c), PRIMARY KEY(c, d) );
         SELECT count(*) FROM "_index" JOIN "_space" WHERE "_index"."id" = "_space"."id" AND "_space"."name"='T7';
     ]], {
         -- <index-16.5>
@@ -952,7 +951,7 @@ test:do_execsql_test(
     "index-17.1",
     [[
         DROP TABLE t7;
-        CREATE TABLE t7(c, d UNIQUE, UNIQUE(c), PRIMARY KEY(c, d) );
+        CREATE TABLE t7(c INT , d  INT UNIQUE, UNIQUE(c), PRIMARY KEY(c, d) );
         SELECT "_index"."name" FROM "_index" JOIN "_space" WHERE "_index"."id" = "_space"."id" AND "_space"."name"='T7';
     ]], {
         -- <index-17.1>
@@ -1005,7 +1004,7 @@ if (0 > 0)
     test:do_catchsql_test(
         "index-21.2",
         [[
-            CREATE TABLE t6(x primary key);
+            CREATE TABLE t6(x  INT primary key);
             INSERT INTO temp.t6 values(1),(5),(9);
             CREATE INDEX temp.i21 ON t6(x);
             SELECT x FROM t6 ORDER BY x DESC;
@@ -1017,5 +1016,5 @@ if (0 > 0)
 
 end
 
-
+::exe::
 test:finish_test()
diff --git a/test/sql-tap/index2.test.lua b/test/sql-tap/index2.test.lua
index f9176b872..0efd484bd 100755
--- a/test/sql-tap/index2.test.lua
+++ b/test/sql-tap/index2.test.lua
@@ -26,9 +26,9 @@ local ROW_NUM = 100 -- was 100
 test:do_test(
     "index2-1.1",
     function()
-        local sql_parts = {"CREATE TABLE t1(id primary key"}
+        local sql_parts = {"CREATE TABLE t1(id  INT primary key"}
         for i = 1, COL_NUM, 1 do
-            table.insert(sql_parts, "c"..i)
+            table.insert(sql_parts, "c"..i .. ' INT')
         end
         local sql = table.concat(sql_parts, ",")..");"
         return test:execsql(sql)
diff --git a/test/sql-tap/index3.test.lua b/test/sql-tap/index3.test.lua
index 7f6baa6a9..9765381bf 100755
--- a/test/sql-tap/index3.test.lua
+++ b/test/sql-tap/index3.test.lua
@@ -25,7 +25,7 @@ test:plan(2)
 test:do_execsql_test(
     "index3-1.1",
     [[
-        CREATE TABLE t1(id primary key, a);
+        CREATE TABLE t1(id  INT primary key, a INT );
         INSERT INTO t1 VALUES(1, 1);
         INSERT INTO t1 VALUES(2, 1);
         SELECT a FROM t1;
@@ -56,7 +56,7 @@ test:do_execsql_test(
     "index3-2.1",
     [[
         DROP TABLE t1;
-        CREATE TABLE t1(a, b, c, d, e, 
+        CREATE TABLE t1(a INT , b TEXT , c INT , d INT , e INT , 
                         PRIMARY KEY(a), UNIQUE(b COLLATE "unicode_ci" DESC));
         CREATE INDEX t1c ON t1(c);
         CREATE INDEX t1d ON t1(d COLLATE binary ASC);
diff --git a/test/sql-tap/index4.test.lua b/test/sql-tap/index4.test.lua
index 69b7ebcf9..e42b0c957 100755
--- a/test/sql-tap/index4.test.lua
+++ b/test/sql-tap/index4.test.lua
@@ -22,7 +22,7 @@ testprefix = "index4"
 test:do_execsql_test(
     1.1,
     [[
-          CREATE TABLE t1(x primary key);
+        CREATE TABLE t1(x BLOB primary key);
         START TRANSACTION;
           INSERT INTO t1 VALUES(randomblob(102));
           INSERT INTO t1 SELECT randomblob(102) FROM t1;     --     2
@@ -78,7 +78,7 @@ test:do_execsql_test(
     1.6,
     [[
           DROP TABLE t1;
-          CREATE TABLE t1(x primary key);
+          CREATE TABLE t1(x BLOB primary key);
         START TRANSACTION;
           INSERT INTO t1 VALUES('a');
           INSERT INTO t1 VALUES('b');
@@ -107,7 +107,7 @@ test:do_execsql_test(
     [[
         --START TRANSACTION;
           DROP TABLE t1;
-          CREATE TABLE t1(x primary key);
+          CREATE TABLE t1(x TEXT primary key);
           INSERT INTO t1 VALUES('a');
         --COMMIT;
         CREATE INDEX i1 ON t1(x); 
@@ -126,7 +126,7 @@ if (1 > 0)
         [[
             --START TRANSACTION;
               DROP TABLE t1;
-              CREATE TABLE t1(x primary key);
+              CREATE TABLE t1(x INT primary key);
             --COMMIT;
             CREATE INDEX i1 ON t1(x); 
             --PRAGMA integrity_check
@@ -140,7 +140,7 @@ end
 test:do_execsql_test(
     2.1,
     [[
-          CREATE TABLE t2(id primary key, x);
+          CREATE TABLE t2(id INT primary key, x INT);
         START TRANSACTION;
           INSERT INTO t2 VALUES(1, 14);
           INSERT INTO t2 VALUES(2, 35);
diff --git a/test/sql-tap/index6.test.lua b/test/sql-tap/index6.test.lua
index af18e89d4..05385efe6 100755
--- a/test/sql-tap/index6.test.lua
+++ b/test/sql-tap/index6.test.lua
@@ -24,7 +24,7 @@ test:plan(14)
 -- do_test index6-1.1 {
 --   # Able to parse and manage partial indices
 --   execsql {
---     CREATE TABLE t1(a,b,c);
+--     CREATE TABLE t1(a INT ,b INT ,c INT );
 --     CREATE INDEX t1a ON t1(a) WHERE a IS NOT NULL;
 --     CREATE INDEX t1b ON t1(b) WHERE b>10;
 --     CREATE VIRTUAL TABLE nums USING wholenumber;
@@ -117,7 +117,7 @@ test:plan(14)
 -- #
 -- do_test index6-2.1 {
 --   execsql {
---     CREATE TABLE t2(a,b);
+--     CREATE TABLE t2(a INT ,b INT );
 --     INSERT INTO t2(a,b) SELECT value, value FROM nums WHERE value<1000;
 --     UPDATE t2 SET a=NULL WHERE b%2==0;
 --     CREATE INDEX t2a1 ON t2(a) WHERE a IS NOT NULL;
@@ -182,7 +182,7 @@ test:plan(14)
 -- # Partial UNIQUE indices
 -- #
 -- do_execsql_test index6-3.1 {
---   CREATE TABLE t3(a,b);
+--   CREATE TABLE t3(a INT ,b INT );
 --   INSERT INTO t3 SELECT value, value FROM nums WHERE value<200;
 --   UPDATE t3 SET a=999 WHERE b%5!=0;
 --   CREATE UNIQUE INDEX t3a ON t3(a) WHERE a<>999;
@@ -227,7 +227,7 @@ test:do_execsql_test(
         -- </index6-6.0>
     })
 else
-    test:execsql("CREATE TABLE t6(a,b, PRIMARY KEY (a,b));")
+    test:execsql("CREATE TABLE t6(a INT ,b INT , PRIMARY KEY (a,b));")
     test:execsql("INSERT INTO t6(a,b) VALUES(123,456);")
 end
 
@@ -252,8 +252,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "index6-7.0",
     [[
-        CREATE TABLE t7a(id primary key, x);
-        CREATE TABLE t7b(id primary key, y);
+        CREATE TABLE t7a(id  INT primary key, x INT );
+        CREATE TABLE t7b(id  INT primary key, y INT );
         INSERT INTO t7a VALUES(1, 1);
         CREATE INDEX t7ax ON t7a(x);
         SELECT x,y FROM t7a LEFT JOIN t7b ON (x=99) ORDER BY x;
@@ -309,8 +309,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "index6-8.0",
     [[
-        CREATE TABLE t8a(id primary key, a,b);
-        CREATE TABLE t8b(id primary key, x,y);
+        CREATE TABLE t8a(id INT primary key, a INT,b TEXT);
+        CREATE TABLE t8b(id INT primary key, x TEXT,y INT);
         CREATE INDEX i8c ON t8b(y);
 
         INSERT INTO t8a VALUES(1, 1, 'one');
@@ -387,7 +387,7 @@ end
 test:do_execsql_test(
     "index6-10.1",
     [[
-        CREATE TABLE t10(a,b,c,d,e INTEGER PRIMARY KEY);
+        CREATE TABLE t10(a INT ,b INT ,c INT ,d INT ,e INTEGER PRIMARY KEY);
         INSERT INTO t10 VALUES
           (1,2,3,4,5),
           (2,3,4,5,6),
diff --git a/test/sql-tap/index7.test.lua b/test/sql-tap/index7.test.lua
index 7d4a54723..03b1e7044 100755
--- a/test/sql-tap/index7.test.lua
+++ b/test/sql-tap/index7.test.lua
@@ -30,7 +30,7 @@ end
 -- do_test index7-1.1 {
 --   # Able to parse and manage partial indices
 --   execsql {
---     CREATE TABLE t1(a,b,c PRIMARY KEY) WITHOUT rowid;
+--     CREATE TABLE t1(a INT,b INT,c INT PRIMARY KEY) WITHOUT rowid;
 --     CREATE INDEX t1a ON t1(a) WHERE a IS NOT NULL;
 --     CREATE INDEX t1b ON t1(b) WHERE b>10;
 --     CREATE VIRTUAL TABLE nums USING wholenumber;
@@ -138,7 +138,7 @@ end
 -- #
 -- do_test index7-2.1 {
 --   execsql {
---     CREATE TABLE t2(a,b PRIMARY KEY) without rowid;
+--     CREATE TABLE t2(a INT,b INT PRIMARY KEY) without rowid;
 --     INSERT INTO t2(a,b) SELECT value, value FROM nums WHERE value<1000;
 --     UPDATE t2 SET a=NULL WHERE b%5==0;
 --     CREATE INDEX t2a1 ON t2(a) WHERE a IS NOT NULL;
@@ -203,7 +203,7 @@ end
 -- # Partial UNIQUE indices
 -- #
 -- do_execsql_test index7-3.1 {
---   CREATE TABLE t3(a,b PRIMARY KEY) without rowid;
+--   CREATE TABLE t3(a INT,b INT PRIMARY KEY) without rowid;
 --   INSERT INTO t3 SELECT value, value FROM nums WHERE value<200;
 --   UPDATE t3 SET a=999 WHERE b%5!=0;
 --   CREATE UNIQUE INDEX t3a ON t3(a) WHERE a<>999;
@@ -239,8 +239,8 @@ end
 test:do_execsql_test(
     "index7-6.1",
     [[
-        CREATE TABLE t5(id primary key, a, b);
-        CREATE TABLE t4(id primary key, c, d);
+        CREATE TABLE t5(id INT primary key, a INT, b TEXT);
+        CREATE TABLE t4(id INT primary key, c TEXT, d TEXT);
         INSERT INTO t5 VALUES(1, 1, 'xyz');
         INSERT INTO t4 VALUES(1, 'abc', 'not xyz');
         SELECT a,b,c,d FROM (SELECT a,b FROM t5 WHERE a=1 AND b='xyz'), t4 WHERE c='abc';
@@ -305,7 +305,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
         "index7-8.1",
         [[
-            CREATE TABLE t(a,b,c, PRIMARY KEY(a));
+            CREATE TABLE t(a INT,b INT,c INT, PRIMARY KEY(a));
             CREATE INDEX i1 ON t(a, a, b, c, c, b, b, b, c, b, c);
             pragma index_info = t.i1;
         ]],
@@ -324,7 +324,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
         "index7-8.2",
         [[
-            CREATE TABLE test4(a,b,c,d, PRIMARY KEY(a,a,a,b,c));
+            CREATE TABLE test4(a INT,b INT, c INT, d INT, PRIMARY KEY(a,a,a,b,c));
             CREATE INDEX index1 on test4(b,c,a,c);
             SELECT "_index"."name"
             FROM "_index" JOIN "_space" WHERE
@@ -341,7 +341,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
         "index7-8.3",
         [[
-            CREATE TABLE test5(a,b,c,d, PRIMARY KEY(a), UNIQUE(a));
+            CREATE TABLE test5(a INT,b INT,c INT,d INT, PRIMARY KEY(a), UNIQUE(a));
             SELECT "_index"."name", "_index"."iid"
             FROM "_index" JOIN "_space" WHERE
                 "_index"."id" = "_space"."id" AND
@@ -357,7 +357,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
         "index7-8.4",
         [[
-            CREATE TABLE test6(a,b,c,d, PRIMARY KEY(a), CONSTRAINT c1 UNIQUE(a));
+            CREATE TABLE test6(a INT,b INT,c INT,d INT, PRIMARY KEY(a), CONSTRAINT c1 UNIQUE(a));
             SELECT "_index"."name", "_index"."iid"
             FROM "_index" JOIN "_space" WHERE
                 "_index"."id" = "_space"."id" AND
@@ -372,7 +372,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
         "index7-8.5",
         [[
-            CREATE TABLE test7(a,b,c,d, UNIQUE(a), PRIMARY KEY(a));
+            CREATE TABLE test7(a INT,b INT,c INT,d INT, UNIQUE(a), PRIMARY KEY(a));
             SELECT "_index"."name", "_index"."iid"
             FROM "_index" JOIN "_space" WHERE
                 "_index"."id" = "_space"."id" AND
@@ -387,7 +387,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
         "index7-8.6",
         [[
-            CREATE TABLE test8(a,b,c,d, CONSTRAINT c1 UNIQUE(a), PRIMARY KEY(a));
+            CREATE TABLE test8(a INT,b INT,c INT,d INT, CONSTRAINT c1 UNIQUE(a), PRIMARY KEY(a));
             SELECT "_index"."name", "_index"."iid"
             FROM "_index" JOIN "_space" WHERE
                 "_index"."id" = "_space"."id" AND
diff --git a/test/sql-tap/insert1.test.lua b/test/sql-tap/insert1.test.lua
index cfca0025f..547430bac 100755
--- a/test/sql-tap/insert1.test.lua
+++ b/test/sql-tap/insert1.test.lua
@@ -213,7 +213,7 @@ end, {
 -- Test of expressions in the VALUES clause
 --
 test:do_execsql_test("insert-4.1", [[
-  CREATE TABLE t3(a PRIMARY KEY,b,c);
+  CREATE TABLE t3(a INT PRIMARY KEY,b INT,c INT);
   INSERT INTO t3 VALUES(1+2+3,4,5);
   SELECT * FROM t3;
 ]], {
@@ -286,7 +286,7 @@ test:do_execsql_test("insert-4.7", [[
 --
 -- if X(0, "X!capable", [["tempdb"]]) then
   test:do_execsql_test("insert-5.1", [[
-    CREATE TABLE t4(x PRIMARY KEY);
+    CREATE TABLE t4(x INT PRIMARY KEY);
     INSERT INTO t4 VALUES(1);
     SELECT * FROM t4;
   ]], {
@@ -362,7 +362,7 @@ test:do_execsql_test("insert-4.7", [[
   -- The REPLACE command is not available if SQLITE_OMIT_CONFLICT is 
   -- defined at compilation time.
   test:do_execsql_test("insert-6.1", [[
-    CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE);
+    CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT UNIQUE);
     INSERT INTO t1 VALUES(1,2);
     INSERT INTO t1 VALUES(2,3);
     SELECT b FROM t1 WHERE b=2;
@@ -402,7 +402,7 @@ test:do_execsql_test("insert-4.7", [[
 -- # INSERT statments.
 -- do_test insert-7.1 {
 --   execsql {
---     CREATE TABLE t1(a);
+--     CREATE TABLE t1(a INT);
 --     INSERT INTO t1 VALUES(1);
 --     INSERT INTO t1 VALUES(2);
 --     CREATE INDEX i1 ON t1(a);
@@ -434,7 +434,7 @@ test:do_execsql_test("insert-4.7", [[
 -- #
 -- do_test insert-9.1 {
 --   execsql {
---     CREATE TABLE t5(x);
+--     CREATE TABLE t5(x INT);
 --     INSERT INTO t5 VALUES(1);
 --     INSERT INTO t5 VALUES(2);
 --     INSERT INTO t5 VALUES(3);
@@ -445,7 +445,7 @@ test:do_execsql_test("insert-4.7", [[
 -- MUST_WORK_TEST
 -- do_test insert-9.2 {
 --   execsql {
---     CREATE TABLE t6(x INTEGER PRIMARY KEY, y);
+--     CREATE TABLE t6(x INTEGER PRIMARY KEY, y INT);
 --     INSERT INTO t6 VALUES(1,1);
 --     INSERT INTO t6 VALUES(2,2);
 --     INSERT INTO t6 VALUES(3,3);
@@ -457,7 +457,7 @@ test:do_execsql_test("insert-4.7", [[
 --
 -- if X(0, "X!capable", [["compound"]]) then
   test:do_execsql_test("insert-10.1", [[
-    CREATE TABLE t10(a PRIMARY KEY,b,c);
+    CREATE TABLE t10(a  INT PRIMARY KEY,b INT,c INT);
     INSERT INTO t10 VALUES(1,2,3), (4,5,6), (7,8,9);
     SELECT * FROM t10;
   ]], {
@@ -480,7 +480,7 @@ test:do_execsql_test("insert-4.7", [[
 -- #
 -- do_execsql_test insert-11.1 {
 --   CREATE TABLE t11a AS SELECT '123456789' AS x;
---   CREATE TABLE t11b (a INTEGER PRIMARY KEY, b, c);
+--   CREATE TABLE t11b (a INTEGER PRIMARY KEY, b INT, c INT);
 --   INSERT INTO t11b SELECT x, x, x FROM t11a;
 --   SELECT quote(a), quote(b), quote(c) FROM t11b;
 -- } {123456789 '123456789' '123456789'}
@@ -488,9 +488,9 @@ test:do_execsql_test("insert-4.7", [[
 -- # Ticket http://www.sqlite.org/src/info/e9654505cfda9361
 -- #
 -- do_execsql_test insert-12.1 {
---   CREATE TABLE t12a(a,b,c,d,e,f,g);
+--   CREATE TABLE t12a(a INT,b INT,c INT,d INT,e INT,f INT,g INT);
 --   INSERT INTO t12a VALUES(101,102,103,104,105,106,107);
---   CREATE TABLE t12b(x);
+--   CREATE TABLE t12b(x INT);
 --   INSERT INTO t12b(x,rowid,x,x,x,x,x) SELECT * FROM t12a;
 --   SELECT rowid, x FROM t12b;
 -- } {102 101}
@@ -501,7 +501,7 @@ test:do_execsql_test("insert-4.7", [[
 --   SELECT * FROM tab1;
 -- } {11 22}
 -- do_execsql_test insert-12.3 {
---   CREATE TABLE t12c(a, b DEFAULT 'xyzzy', c);
+--   CREATE TABLE t12c(a INT, b INT DEFAULT 'xyzzy', c INT);
 --   INSERT INTO t12c(a, rowid, c) SELECT 'one', 999, 'two';
 --   SELECT * FROM t12c;
 -- } {one xyzzy two}
@@ -511,7 +511,7 @@ test:do_execsql_test("insert-4.7", [[
 test:do_execsql_test(
     "insert-13.0",
     [[
-        create table test(a primary key, b)
+        create table test(a  INT primary key, b INT )
     ]])
 
 test:do_catchsql_test(
diff --git a/test/sql-tap/insert3.test.lua b/test/sql-tap/insert3.test.lua
index c0e9d9556..720f5d7de 100755
--- a/test/sql-tap/insert3.test.lua
+++ b/test/sql-tap/insert3.test.lua
@@ -28,8 +28,8 @@ test:plan(18)
 test:do_execsql_test(
     "insert3-1.0",
     [[
-            CREATE TABLE t1(rowid INTEGER PRIMARY KEY AUTOINCREMENT, a,b);
-            CREATE TABLE log(rowid INTEGER PRIMARY KEY AUTOINCREMENT, x UNIQUE, y);
+            CREATE TABLE t1(rowid INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT );
+            CREATE TABLE log(rowid INTEGER PRIMARY KEY AUTOINCREMENT, x  INT UNIQUE, y INT );
             CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
               UPDATE log SET y=y+1 WHERE x=new.a;
               INSERT OR IGNORE INTO log(x, y) VALUES(new.a, 1);
@@ -57,7 +57,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "insert3-1.2",
     [[
-            CREATE TABLE log2(rowid INTEGER PRIMARY KEY AUTOINCREMENT, x UNIQUE,y);
+            CREATE TABLE log2(rowid INTEGER PRIMARY KEY AUTOINCREMENT, x  INT UNIQUE,y INT );
             CREATE TRIGGER r2 BEFORE INSERT ON t1 BEGIN
               UPDATE log2 SET y=y+1 WHERE x=new.b;
               INSERT OR IGNORE INTO log2(x, y) VALUES(new.b,1);
@@ -121,10 +121,10 @@ test:do_execsql_test(
     [[
             CREATE TABLE t2(
               a INTEGER PRIMARY KEY AUTOINCREMENT,
-              b DEFAULT 'b',
-              c DEFAULT 'c'
+              b  INT DEFAULT 'b',
+              c  INT DEFAULT 'c'
             );
-            CREATE TABLE t2dup(rowid INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c);
+            CREATE TABLE t2dup(rowid INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT ,c INT );
             CREATE TRIGGER t2r1 BEFORE INSERT ON t2 BEGIN
               INSERT INTO t2dup(a,b,c) VALUES(new.a,new.b,new.c);
             END;
@@ -157,7 +157,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "insert3-3.1",
     [[
-            CREATE TABLE t3(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c);
+            CREATE TABLE t3(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT ,c INT );
             CREATE TRIGGER t3r1 BEFORE INSERT on t3 WHEN nosuchcol BEGIN
               SELECT 'illegal WHEN clause';
             END;
@@ -179,7 +179,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "insert3-3.3",
     [[
-            CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, a,b,c);
+            CREATE TABLE t4(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT ,b INT ,c INT );
             CREATE TRIGGER t4r1 AFTER INSERT on t4 WHEN nosuchcol BEGIN
               SELECT 'illegal WHEN clause';
             END;
@@ -209,7 +209,7 @@ test:do_execsql_test(
     [[
             CREATE TABLE t5(
               a INTEGER PRIMARY KEY AUTOINCREMENT,
-              b DEFAULT 'xyz'
+              b  INT DEFAULT 'xyz'
             );
             INSERT INTO t5 DEFAULT VALUES;
             SELECT * FROM t5;
@@ -233,7 +233,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "insert3-3.7",
     [[
-            CREATE TABLE t6(id INTEGER PRIMARY KEY AUTOINCREMENT, x,y DEFAULT 4.3, z DEFAULT x'6869');
+            CREATE TABLE t6(id INTEGER PRIMARY KEY AUTOINCREMENT, x INT ,y  INT DEFAULT 4.3, z  INT DEFAULT x'6869');
             INSERT INTO t6 DEFAULT VALUES;
             SELECT * FROM t6;
     ]], {
@@ -273,7 +273,7 @@ test:drop_all_tables()
 --         "insert3-4.1",
 --         function()
 --             test:execsql([[
---                 CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a, b, c);
+--                 CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a INT , b INT , c INT );
 --                 CREATE INDEX i1 ON t1(a, b);
 --                 BEGIN;
 --                 INSERT INTO t1 (a,b,c)VALUES(randstr(10,400),randstr(10,400),randstr(10,400));
diff --git a/test/sql-tap/intpkey.test.lua b/test/sql-tap/intpkey.test.lua
index 35a436ef8..132d9a37f 100755
--- a/test/sql-tap/intpkey.test.lua
+++ b/test/sql-tap/intpkey.test.lua
@@ -27,7 +27,7 @@ test:plan(39)
 test:do_execsql_test(
     "intpkey-1.0",
     [[
-        CREATE TABLE t1(a TEXT PRIMARY KEY, b, c);
+        CREATE TABLE t1(a TEXT PRIMARY KEY, b INT, c INT);
     ]], {
         -- <intpkey-1.0>
         
@@ -53,7 +53,7 @@ test:do_execsql_test(
     "intpkey-1.2",
     [[
         DROP TABLE t1;
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c TEXT);
         --SELECT name FROM sqlite_master
         --  WHERE type='index' AND tbl_name='t1';
     ]], {
@@ -660,7 +660,7 @@ if (0 > 0) then
 test:do_execsql_test(
     "intpkey-8.1",
     [[
-        CREATE TABLE t2(x INTEGER PRIMARY KEY, y, z);
+        CREATE TABLE t2(x INTEGER PRIMARY KEY, y INT, z INT);
         INSERT INTO t2 SELECT * FROM t1;
         --SELECT rowid FROM t2;
         SELECT x FROM t2;
@@ -701,7 +701,7 @@ if (0 > 0)
         "intpkey-10.1",
         [[
             DROP TABLE t2;
-            CREATE TABLE t2(x INTEGER PRIMARY KEY, y, z);
+            CREATE TABLE t2(x INTEGER PRIMARY KEY, y INT, z INT);
             INSERT INTO t2 VALUES(NULL, 1, 2);
             SELECT * from t2;
         ]], {
@@ -777,7 +777,7 @@ test:do_execsql_test(
         SELECT * FROM t1 WHERE a=1;
     ]], {
         -- <intpkey-13.2>
-        1, 2, 3
+        1, "2", "3"
         -- </intpkey-13.2>
     })
 
diff --git a/test/sql-tap/join.test.lua b/test/sql-tap/join.test.lua
index ac05a98b2..4e4ec6422 100755
--- a/test/sql-tap/join.test.lua
+++ b/test/sql-tap/join.test.lua
@@ -24,7 +24,7 @@ test:plan(92)
 test:do_execsql_test(
     "join-1.1",
     [[
-        CREATE TABLE t1(a primary key,b,c);
+        CREATE TABLE t1(a INT primary key,b INT,c INT);
         INSERT INTO t1 VALUES(1,2,3);
         INSERT INTO t1 VALUES(2,3,4);
         INSERT INTO t1 VALUES(3,4,5);
@@ -38,7 +38,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "join-1.2",
     [[
-        CREATE TABLE t2(b primary key,c,d);
+        CREATE TABLE t2(b INT primary key,c INT,d INT);
         INSERT INTO t2 VALUES(1,2,3);
         INSERT INTO t2 VALUES(2,3,4);
         INSERT INTO t2 VALUES(3,4,5);
@@ -348,7 +348,7 @@ test:do_execsql2_test(
 test:do_execsql_test(
     "join-1.15",
     [[
-        CREATE TABLE t3(c primary key,d,e);
+        CREATE TABLE t3(c INT primary key,d INT,e INT);
         INSERT INTO t3 VALUES(2,3,4);
         INSERT INTO t3 VALUES(3,4,5);
         INSERT INTO t3 VALUES(4,5,6);
@@ -382,7 +382,7 @@ test:do_execsql2_test(
 test:do_execsql_test(
     "join-1.18",
     [[
-        CREATE TABLE t4(d primary key,e,f);
+        CREATE TABLE t4(d INT primary key,e INT,f INT);
         INSERT INTO t4 VALUES(2,3,4);
         INSERT INTO t4 VALUES(3,4,5);
         INSERT INTO t4 VALUES(4,5,6);
@@ -708,8 +708,8 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "join-5.1",
     [[
-        create table centros (id integer primary key, centro);
-        create table usuarios (id integer primary key, nombre, apellidos,
+        create table centros (id integer primary key, centro TEXT);
+        create table usuarios (id integer primary key, nombre TEXT, apellidos TEXT,
         idcentro integer);
         START TRANSACTION;
         INSERT INTO centros VALUES(1,'xxx');
@@ -733,7 +733,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "join-7.1",
     [[
-        CREATE TABLE t7 (id primary key, x, y);
+        CREATE TABLE t7 (id INT primary key, x TEXT, y INT);
         INSERT INTO t7 VALUES (1, 'pa1', 1);
         INSERT INTO t7 VALUES (2, 'pa2', NULL);
         INSERT INTO t7 VALUES (3, 'pa3', NULL);
@@ -742,7 +742,7 @@ test:do_execsql_test(
         INSERT INTO t7 VALUES (6, 'pa31', 130);
         INSERT INTO t7 VALUES (7, 'pa28', NULL);
 
-        CREATE TABLE t8 (a integer primary key, b);
+        CREATE TABLE t8 (a integer primary key, b TEXT);
         INSERT INTO t8 VALUES (1, 'pa1');
         INSERT INTO t8 VALUES (2, 'pa4');
         INSERT INTO t8 VALUES (3, NULL);
@@ -765,13 +765,13 @@ test:do_execsql_test(
 -- do_test join-8.1 {
 --   execsql {
 --     BEGIN;
---     CREATE TABLE t9(a INTEGER PRIMARY KEY, b);
+--     CREATE TABLE t9(a INTEGER PRIMARY KEY, b INT);
 --     INSERT INTO t9 VALUES(1,11);
 --     INSERT INTO t9 VALUES(2,22);
---     CREATE TABLE t10(x INTEGER PRIMARY KEY, y);
+--     CREATE TABLE t10(x INTEGER PRIMARY KEY, y INT);
 --     INSERT INTO t10 VALUES(1,2);
 --     INSERT INTO t10 VALUES(3,3);    
---     CREATE TABLE t11(p INTEGER PRIMARY KEY, q);
+--     CREATE TABLE t11(p INTEGER PRIMARY KEY, q INT);
 --     INSERT INTO t11 VALUES(2,111);
 --     INSERT INTO t11 VALUES(3,333);    
 --     CREATE VIEW v10_11 AS SELECT x, q FROM t10, t11 WHERE t10.y=t11.p;
@@ -816,8 +816,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "join-9.1",
     [[
-        CREATE TABLE t12(a primary key,b);
-        CREATE TABLE t13(b primary key,c);
+        CREATE TABLE t12(a INT primary key,b INT);
+        CREATE TABLE t13(b INT primary key,c INT);
         START TRANSACTION;
         INSERT INTO t12 VALUES(1,11);
         INSERT INTO t12 VALUES(2,22);
@@ -863,8 +863,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "join-10.1",
     [[
-        CREATE TABLE t21(a primary key,b,c);
-        CREATE TABLE t22(p primary key,q);
+        CREATE TABLE t21(a INT primary key,b INT,c INT);
+        CREATE TABLE t22(p INT primary key,q INT);
         CREATE INDEX i22 ON t22(q);
         SELECT a FROM t21 LEFT JOIN t22 ON b=p WHERE q=
            (SELECT max(m.q) FROM t22 m JOIN t21 n ON n.b=m.p WHERE n.c=1);
@@ -881,8 +881,8 @@ test:do_test(
     "join-10.2",
     function()
         test:execsql [[
-            CREATE TABLE t23(a primary key, b, c);
-            CREATE TABLE t24(a primary key, b, c);
+            CREATE TABLE t23(a INT primary key, b INT, c INT);
+            CREATE TABLE t24(a INT primary key, b INT, c INT);
             INSERT INTO t23 VALUES(1, 2, 3);
         ]]
         return test:execsql [[
@@ -980,8 +980,8 @@ test:do_test(
             DROP TABLE IF EXISTS t2;
         ]]
         return test:execsql [[
-            CREATE TABLE t1(id primary key, a COLLATE "unicode_ci", b);
-            CREATE TABLE t2(id primary key, a, b);
+            CREATE TABLE t1(id INT primary key, a TEXT COLLATE "unicode_ci", b INT);
+            CREATE TABLE t2(id INT primary key, a TEXT, b INT);
             INSERT INTO t1 VALUES(1, 'ONE', 1);
             INSERT INTO t1 VALUES(2, 'two', 2);
             INSERT INTO t2 VALUES(1, 'one', 1);
@@ -1015,8 +1015,8 @@ test:do_test(
             DROP TABLE IF EXISTS t2;
         ]]
         return test:execsql [[
-            CREATE TABLE t1(a primary key, b TEXT);
-            CREATE TABLE t2(b INTEGER primary key, a);
+            CREATE TABLE t1(a TEXT primary key, b TEXT);
+            CREATE TABLE t2(b INTEGER primary key, a TEXT);
             INSERT INTO t1 VALUES('one', '1.0');
             INSERT INTO t1 VALUES('two', '2');
             INSERT INTO t2 VALUES(1, 'one');
@@ -1054,7 +1054,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "join-12.1",
     [[
-        CREATE TABLE t14(x primary key);
+        CREATE TABLE t14(x TEXT primary key);
         INSERT INTO t14 VALUES('abcdefghij');
     ]])
 
@@ -1092,9 +1092,9 @@ jointest("join-12.13", 65537, {1, 'at most 64 tables in a join'})
 test:do_execsql_test(
     "join-13.0",
     [[
-        CREATE TABLE aa(a primary key);
-        CREATE TABLE bb(b primary key);
-        CREATE TABLE cc(id primary key, c);
+        CREATE TABLE aa(a INT primary key);
+        CREATE TABLE bb(b INT primary key);
+        CREATE TABLE cc(id INT primary key, c INT);
 
         INSERT INTO aa VALUES(45);
         INSERT INTO cc VALUES(1, 45);
diff --git a/test/sql-tap/join2.test.lua b/test/sql-tap/join2.test.lua
index c89331afc..c8b17bd7e 100755
--- a/test/sql-tap/join2.test.lua
+++ b/test/sql-tap/join2.test.lua
@@ -23,7 +23,7 @@ test:plan(7)
 test:do_execsql_test(
     "join2-1.1",
     [[
-        CREATE TABLE t1(a primary key,b);
+        CREATE TABLE t1(a INT primary key,b INT);
         INSERT INTO t1 VALUES(1,11);
         INSERT INTO t1 VALUES(2,22);
         INSERT INTO t1 VALUES(3,33);
@@ -37,7 +37,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "join2-1.2",
     [[
-        CREATE TABLE t2(b primary key,c);
+        CREATE TABLE t2(b INT primary key,c INT);
         INSERT INTO t2 VALUES(11,111);
         INSERT INTO t2 VALUES(33,333);
         INSERT INTO t2 VALUES(44,444);
@@ -51,7 +51,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "join2-1.3",
     [[
-        CREATE TABLE t3(c primary key,d);
+        CREATE TABLE t3(c INT primary key,d INT);
         INSERT INTO t3 VALUES(111,1111);
         INSERT INTO t3 VALUES(444,4444);
         INSERT INTO t3 VALUES(555,5555);
diff --git a/test/sql-tap/join3.test.lua b/test/sql-tap/join3.test.lua
index ee2f261e8..ae091d165 100755
--- a/test/sql-tap/join3.test.lua
+++ b/test/sql-tap/join3.test.lua
@@ -34,7 +34,7 @@ for N=1, bitmask_size do
     test:do_test(
         "join3-1."..N,
         function()
-            test:execsql("CREATE TABLE t"..N.."(x primary key);")
+            test:execsql("CREATE TABLE t"..N.."(x INT primary key);")
             test:execsql(string.format("INSERT INTO t%s VALUES(%s)", N, N))
             sql = "SELECT * FROM t1"
             -- for _ in X(0, "X!for", [=[["set i 2","$i<=$N","incr i"]]=]) do
diff --git a/test/sql-tap/join5.test.lua b/test/sql-tap/join5.test.lua
index 93f44c504..79006a29e 100755
--- a/test/sql-tap/join5.test.lua
+++ b/test/sql-tap/join5.test.lua
@@ -25,8 +25,8 @@ test:do_execsql_test(
     "join5-1.1",
     [[
         CREATE TABLE t1(a integer primary key, b integer, c integer);
-        CREATE TABLE t2(x integer primary key, y);
-        CREATE TABLE t3(p integer primary key, q);
+        CREATE TABLE t2(x integer primary key, y TEXT);
+        CREATE TABLE t3(p integer primary key, q TEXT);
         START TRANSACTION;
         INSERT INTO t3 VALUES(11,'t3-11');
         INSERT INTO t3 VALUES(12,'t3-12');
@@ -90,11 +90,11 @@ test:do_test(
     "join5-2.1",
     function()
         test:execsql [[
-            CREATE TABLE ab(a primary key,b);
+            CREATE TABLE ab(a  INT primary key,b INT );
             INSERT INTO ab VALUES(1,2);
             INSERT INTO ab VALUES(3,NULL);
 
-            CREATE TABLE xy(x,y primary key);
+            CREATE TABLE xy(x INT ,y  INT primary key);
             INSERT INTO xy VALUES(2,3);
             INSERT INTO xy VALUES(NULL,1);
         ]]
@@ -224,10 +224,10 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE x1(a primary key);
+        CREATE TABLE x1(a  INT primary key);
         INSERT INTO x1 VALUES(1);
-        CREATE TABLE x2(b NOT NULL primary key);
-        CREATE TABLE x3(c primary key, d);
+        CREATE TABLE x2(b TEXT NOT NULL primary key);
+        CREATE TABLE x3(c TEXT primary key, d TEXT);
         INSERT INTO x3 VALUES('a', NULL);
         INSERT INTO x3 VALUES('b', NULL);
         INSERT INTO x3 VALUES('c', NULL);
@@ -276,10 +276,10 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS x1;
         DROP TABLE IF EXISTS x2;
         DROP TABLE IF EXISTS x3;
-        CREATE TABLE x1(a primary key);
+        CREATE TABLE x1(a  INT primary key);
         INSERT INTO x1 VALUES(1);
-        CREATE TABLE x2(b NOT NULL primary key);
-        CREATE TABLE x3(c primary key, d);
+        CREATE TABLE x2(b TEXT NOT NULL primary key);
+        CREATE TABLE x3(c TEXT primary key, d INT );
         INSERT INTO x3 VALUES('a', NULL);
         INSERT INTO x3 VALUES('b', NULL);
         INSERT INTO x3 VALUES('c', NULL);
diff --git a/test/sql-tap/join6.test.lua b/test/sql-tap/join6.test.lua
index 27480b723..896f61960 100755
--- a/test/sql-tap/join6.test.lua
+++ b/test/sql-tap/join6.test.lua
@@ -28,9 +28,9 @@ test:plan(14)
 test:do_execsql_test(
     "join6-1.1",
     [[
-        CREATE TABLE t1(a primary key);
-        CREATE TABLE t2(a primary key);
-        CREATE TABLE t3(a primary key,b);
+        CREATE TABLE t1(a INT primary key);
+        CREATE TABLE t2(a INT primary key);
+        CREATE TABLE t3(a INT primary key,b INT);
         INSERT INTO t1 VALUES(1);
         INSERT INTO t3 VALUES(1,2);
 
@@ -70,9 +70,9 @@ test:do_execsql_test(
         DROP TABLE t2;
         DROP TABLE t3;
 
-        CREATE TABLE t1(x primary key,y);
-        CREATE TABLE t2(y primary key,z);
-        CREATE TABLE t3(x primary key,z);
+        CREATE TABLE t1(x INT primary key,y INT);
+        CREATE TABLE t2(y INT primary key,z INT);
+        CREATE TABLE t3(x INT primary key,z INT);
 
         INSERT INTO t1 VALUES(1,2);
         INSERT INTO t1 VALUES(3,4);
@@ -107,15 +107,15 @@ test:do_execsql_test(
         DROP TABLE t2;
         DROP TABLE t3;
 
-        CREATE TABLE t1(a primary key,x,y);
+        CREATE TABLE t1(a INT primary key,x INT,y INT);
         INSERT INTO t1 VALUES(1,91,92);
         INSERT INTO t1 VALUES(2,93,94);
 
-        CREATE TABLE t2(b primary key,y,z);
+        CREATE TABLE t2(b INT primary key,y INT,z INT);
         INSERT INTO t2 VALUES(3,92,93);
         INSERT INTO t2 VALUES(4,94,95);
 
-        CREATE TABLE t3(c primary key,x,z);
+        CREATE TABLE t3(c INT primary key,x INT,z INT);
         INSERT INTO t3 VALUES(5,91,93);
         INSERT INTO t3 VALUES(6,99,95);
 
diff --git a/test/sql-tap/keyword1.test.lua b/test/sql-tap/keyword1.test.lua
index fbcd17327..6895dc16e 100755
--- a/test/sql-tap/keyword1.test.lua
+++ b/test/sql-tap/keyword1.test.lua
@@ -20,7 +20,7 @@ test:plan(175)
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
 test:execsql [[
-    CREATE TABLE t1(a PRIMARY KEY, b);
+    CREATE TABLE t1(a INT PRIMARY KEY, b TEXT);
     INSERT INTO t1 VALUES(1, 'one');
     INSERT INTO t1 VALUES(2, 'two');
     INSERT INTO t1 VALUES(3, 'three');
@@ -200,9 +200,9 @@ for _, kw in ipairs(kwlist) do
         "keyword1-"..kw..".1",
         function()
             if (kw == "if") then
-                test:execsql( string.format([[CREATE TABLE "%s"(%s %s PRIMARY KEY)]], kw:upper(), kw, kw))
+                test:execsql( string.format([[CREATE TABLE "%s"(%s %s PRIMARY KEY)]], kw:upper(), kw, 'INT'))
             else
-                test:execsql(string.format("CREATE TABLE %s(%s %s PRIMARY KEY)", kw, kw, kw))
+                test:execsql(string.format("CREATE TABLE %s(%s %s PRIMARY KEY)", kw, kw, 'INT'))
             end
             test:execsql("INSERT INTO "..kw.." VALUES(99)")
             test:execsql("INSERT INTO "..kw.." SELECT a FROM t1")
diff --git a/test/sql-tap/like2.test.lua b/test/sql-tap/like2.test.lua
index abcac39fb..0e7ebdfd6 100755
--- a/test/sql-tap/like2.test.lua
+++ b/test/sql-tap/like2.test.lua
@@ -25,7 +25,7 @@ test:do_test(
     "like2-1.1",
     function()
         return test:execsql [=[
-            CREATE TABLE t1(x INT PRIMARY KEY, y COLLATE "unicode_ci");
+            CREATE TABLE t1(x INT PRIMARY KEY, y  TEXT COLLATE "unicode_ci");
             INSERT INTO t1(x,y) VALUES(1,CAST(x'01' AS TEXT));
             INSERT INTO t1(x,y) VALUES(2,CAST(x'02' AS TEXT));
             INSERT INTO t1(x,y) VALUES(3,CAST(x'03' AS TEXT));
@@ -165,7 +165,7 @@ test:do_test(
     "like2-1.2",
     function()
         return test:execsql [[
-            CREATE TABLE t2(x INT PRIMARY KEY, y COLLATE "unicode_ci");
+            CREATE TABLE t2(x INT PRIMARY KEY, y  TEXT COLLATE "unicode_ci");
             INSERT INTO t2 SELECT * FROM t1;
             CREATE INDEX i2 ON t2(y);
             SELECT count(*) FROM t2;
@@ -180,7 +180,7 @@ test:do_test(
     "like2-1.3",
     function()
         return test:execsql [[
-            CREATE TABLE t3(x INT PRIMARY KEY, y COLLATE "unicode_ci");
+            CREATE TABLE t3(x INT PRIMARY KEY, y  TEXT COLLATE "unicode_ci");
             INSERT INTO t3 SELECT x, 'abc' || y || 'xyz' FROM t1;
             CREATE INDEX i3 ON t3(y);
             SELECT count(*) FROM t2;
diff --git a/test/sql-tap/like3.test.lua b/test/sql-tap/like3.test.lua
index 505d2fabb..ea6824ba7 100755
--- a/test/sql-tap/like3.test.lua
+++ b/test/sql-tap/like3.test.lua
@@ -35,14 +35,14 @@ test:plan(7)
 
 test:execsql([[
     --PRAGMA encoding='UTF8';
-    CREATE TABLE t1(a PRIMARY KEY,b TEXT COLLATE "unicode_ci");
+    CREATE TABLE t1(a INT PRIMARY KEY,b TEXT COLLATE "unicode_ci");
     INSERT INTO t1(a,b)
        VALUES(1,'abc'),
              (2,'ABX'),
              (3,'BCD'),
-             (4,x'616263'),
-             (5,x'414258'),
-             (6,x'424344');
+             (4, char(0x61, 0x62, 0x63)),
+             (5, char(0x41, 0x42, 0x58)),
+             (6, char(0x42, 0x43, 0x44));
     CREATE INDEX t1ba ON t1(b,a);
 ]])
 
@@ -70,7 +70,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "like3-2.0",
     [[
-        CREATE TABLE t2(a PRIMARY KEY, b TEXT);
+        CREATE TABLE t2(a INT PRIMARY KEY, b TEXT);
         INSERT INTO t2 SELECT a, b FROM t1;
         CREATE INDEX t2ba ON t2(b,a);
         SELECT a, b FROM t2 WHERE b GLOB 'ab*' ORDER BY +a;
diff --git a/test/sql-tap/limit.test.lua b/test/sql-tap/limit.test.lua
index 2293107c5..062ba4e38 100755
--- a/test/sql-tap/limit.test.lua
+++ b/test/sql-tap/limit.test.lua
@@ -23,7 +23,7 @@ test:plan(103)
 -- Build some test data
 --
 test:execsql [[
-    CREATE TABLE t1(id primary key, x int, y int);
+    CREATE TABLE t1(id INT primary key, x int, y int);
     START TRANSACTION;
 ]]
 for i=1,32 do
@@ -233,7 +233,7 @@ test:do_test(
     "limit-4.1",
     function()
         return test:execsql [[
-            CREATE TABLE t3(x primary KEY);
+            CREATE TABLE t3(x INT primary KEY);
             START TRANSACTION;
             INSERT INTO t3 SELECT x FROM t1 ORDER BY x LIMIT 10 OFFSET 1;
             INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
@@ -282,7 +282,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "limit-5.1",
     [[
-        CREATE TABLE t5(id primary key, x, y);
+        CREATE TABLE t5(id INT primary key, x INT, y INT);
         INSERT INTO t5 SELECT id, x-y, x+y FROM t1 WHERE x BETWEEN 10 AND 15
             ORDER BY x LIMIT 2;
         SELECT x, y FROM t5 ORDER BY x;
@@ -346,7 +346,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "limit-6.1",
     [[
-        CREATE TABLE t6(a primary key);
+        CREATE TABLE t6(a INT primary key);
         START TRANSACTION;
         INSERT INTO t6 VALUES(1);
         INSERT INTO t6 VALUES(2);
@@ -568,7 +568,7 @@ test:do_execsql_test(
     "limit-9.2.1",
     [[
         --CREATE TABLE t7 AS SELECT * FROM t6;
-        CREATE TABLE t7 (a primary key);
+        CREATE TABLE t7 (a INT primary key);
         INSERT INTO t7 SELECT * FROM t6;
     ]], {
         -- <limit-9.2.1>
@@ -757,7 +757,7 @@ test:do_test(
     "limit-13.1",
     function()
         return test:execsql [[
-            CREATE TABLE t13(x primary key);
+            CREATE TABLE t13(x INT primary key);
             INSERT INTO t13 VALUES(1),(2);
             CREATE VIEW v13a AS SELECT x AS y FROM t13;
             CREATE VIEW v13b AS SELECT y AS z FROM v13a UNION ALL SELECT y+10 FROM v13a;
diff --git a/test/sql-tap/minmax2.test.lua b/test/sql-tap/minmax2.test.lua
index fbb002f36..1c67e0dad 100755
--- a/test/sql-tap/minmax2.test.lua
+++ b/test/sql-tap/minmax2.test.lua
@@ -26,7 +26,7 @@ test:plan(49)
 test:do_execsql_test(
     "minmax2-1.0",
     [[
-        CREATE TABLE t1(id PRIMARY KEY, x, y);
+        CREATE TABLE t1(id  INT PRIMARY KEY, x INT , y INT );
         START TRANSACTION;
         INSERT INTO t1 VALUES(1, 1,1);
         INSERT INTO t1 VALUES(2, 2,2);
@@ -146,7 +146,7 @@ test:do_test(
     "minmax2-2.0",
     function()
         test:execsql [[
-            CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+            CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT );
             INSERT INTO t2 SELECT x, y FROM t1;
         ]]
         sql_search_count = box.sql.debug().sql_search_count
@@ -476,7 +476,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "minmax2-10.1",
     [[
-        CREATE TABLE t6(id primary key, x);
+        CREATE TABLE t6(id  INT primary key, x INT );
         INSERT INTO t6 VALUES(1, 1);
         INSERT INTO t6 VALUES(2, 2);
         INSERT INTO t6 VALUES(3, NULL);
diff --git a/test/sql-tap/minmax3.test.lua b/test/sql-tap/minmax3.test.lua
index d44ddabe1..1ddf39ff5 100755
--- a/test/sql-tap/minmax3.test.lua
+++ b/test/sql-tap/minmax3.test.lua
@@ -46,7 +46,7 @@ test:do_test(
     "minmax3-1.0",
     function()
         test:execsql [[
-            CREATE TABLE t1(id primary key, x, y, z)
+            CREATE TABLE t1(id  INT primary key, x TEXT, y TEXT, z TEXT)
         ]]
         -- db close
         -- set_file_format 4
@@ -284,7 +284,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "minmax3-2.1",
     [[
-        CREATE TABLE t2(id primary key, a, b);
+        CREATE TABLE t2(id  INT primary key, a INT , b INT );
         CREATE INDEX i3 ON t2(a, b);
         INSERT INTO t2 VALUES(1, 1, NULL);
         INSERT INTO t2 VALUES(2, 1, 1);
@@ -377,7 +377,7 @@ test:do_execsql_test(
     "minmax3-3.1",
     [[
         DROP TABLE t2;
-        CREATE TABLE t2(id primary key, a, b);
+        CREATE TABLE t2(id  INT primary key, a INT , b INT );
         CREATE INDEX i3 ON t2(a, b DESC);
         INSERT INTO t2 VALUES(1, 1, NULL);
         INSERT INTO t2 VALUES(2, 1, 1);
@@ -469,7 +469,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "minmax3-4.1",
     [[
-        CREATE TABLE t4(x primary key);
+        CREATE TABLE t4(x TEXT primary key);
         INSERT INTO t4 VALUES('abc');
         INSERT INTO t4 VALUES('BCD');
         SELECT max(x) FROM t4;
diff --git a/test/sql-tap/minmax4.test.lua b/test/sql-tap/minmax4.test.lua
index d17ce8dfd..b600c9bfe 100755
--- a/test/sql-tap/minmax4.test.lua
+++ b/test/sql-tap/minmax4.test.lua
@@ -29,7 +29,7 @@ test:do_test(
     "minmax4-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(p primary key,q);
+            CREATE TABLE t1(p INT primary key,q INT);
             SELECT p, max(q) FROM t1;
         ]]
     end, {
@@ -217,7 +217,7 @@ test:do_test(
     "minmax4-2.1",
     function()
         return test:execsql [[
-            CREATE TABLE t2(a,b,c primary key);
+            CREATE TABLE t2(a INT,b INT,c INT primary key);
             INSERT INTO t2 VALUES
                  (1,null,2),
                  (1,2,3),
diff --git a/test/sql-tap/misc1.test.lua b/test/sql-tap/misc1.test.lua
index cd7792da9..73506ded1 100755
--- a/test/sql-tap/misc1.test.lua
+++ b/test/sql-tap/misc1.test.lua
@@ -28,7 +28,7 @@ test:plan(59)
 test:do_test(
     "misc1-1.1",
     function()
-        local cmd = "CREATE TABLE manycol(id primary key, x0 text"
+        local cmd = "CREATE TABLE manycol(id  INT primary key, x0 text"
         for i = 1, 99, 1 do
             cmd = cmd .. ",x"..i.." text"
         end
@@ -217,7 +217,7 @@ test:do_test(
     "misc1-3.1",
     function()
         local r = test:execsql([[
-            CREATE TABLE t1(a primary KEY);
+            CREATE TABLE t1(a TEXT primary KEY);
             INSERT INTO t1 VALUES('hi');
             PRAGMA full_column_names=on;
             --SELECT rowid, * FROM t1;
@@ -237,7 +237,7 @@ test:do_test(
 test:do_execsql_test(
     "misc1-4.1",
     [[
-        CREATE TABLE t2(a primary key);
+        CREATE TABLE t2(a TEXT primary key);
         START TRANSACTION;
         INSERT INTO t2 VALUES('This is a long string to use up a lot of disk -');
         UPDATE t2 SET a=a||a||a||a;
@@ -262,7 +262,7 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "misc1-5.1",
     [[
-        CREATE TABLE t3(a primary key,b);
+        CREATE TABLE t3(a  INT primary key,b INT );
         INSERT INTO t3 VALUES(1,2);
         INSERT INTO t3 VALUES(3,4);
         UPDATE t3 SET a=0 WHEREwww b=2;
@@ -294,8 +294,8 @@ test:do_catchsql_test(
     "misc1-6.1",
     [[
         CREATE TABLE t4(
-          abort primary key, "asc", beginn, cluster, conflict, copy, delimiters, "desc", endd,
-          "explain", fail, ignore, key, offset, "pragma", "replace", temp, "view"
+          abort  INT primary key, "asc" INT, beginn INT , cluster INT , conflict INT , copy INT , delimiters INT , "desc" INT, endd INT ,
+          "explain" INT, fail INT , ignore INT , key INT , offset INT , "pragma" INT, "replace" INT, temp INT , "view" INT
         );
     ]], {
         -- <misc1-6.1>
@@ -340,8 +340,8 @@ test:do_catchsql_test(
     "misc1-7.1",
     [[
         CREATE TABLE error1(
-          a TYPE PRIMARY KEY,
-          b TYPE PRIMARY KEY
+          a  INT PRIMARY KEY,
+          b  INT PRIMARY KEY
         );
     ]], {
         -- <misc1-7.1>
@@ -354,7 +354,7 @@ test:do_catchsql_test(
     [[
         CREATE TABLE error1(
           a INTEGER PRIMARY KEY,
-          b TYPE PRIMARY KEY
+          b  INT PRIMARY KEY
         );
     ]], {
         -- <misc1-7.2>
@@ -365,7 +365,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "misc1-7.3",
     [[
-        CREATE TABLE t5(a,b,c,PRIMARY KEY(a,b));
+        CREATE TABLE t5(a INT ,b INT ,c INT ,PRIMARY KEY(a,b));
         INSERT INTO t5 VALUES(1,2,3);
         SELECT * FROM t5 ORDER BY a;
     ]], {
@@ -435,7 +435,7 @@ test:execsql([[
 test:do_catchsql_test(
     "misc1-9.1",
     [[
-        CREATE TABLE t1(a primary key not null, b unique not null);
+        CREATE TABLE t1(a  TEXT primary key not null, b  INT unique not null);
         INSERT INTO t1 VALUES('a',1234567890123456789);
         INSERT INTO t1 VALUES('b',1234567891123456789);
         INSERT INTO t1 VALUES('c',1234567892123456789);
@@ -612,7 +612,7 @@ test:do_execsql_test(
         SELECT '0'==0.0
     ]], {
         -- <misc1-12.2>
-        0
+        1
         -- </misc1-12.2>
     })
 
@@ -629,23 +629,23 @@ test:do_execsql_test(
 test:do_execsql_test(
     "misc1-12.4",
     [[
-        CREATE TABLE t6(a INT UNIQUE, b TEXT primary key);
+        CREATE TABLE t6(a TEXT UNIQUE, b TEXT primary key);
         INSERT INTO t6 VALUES('0','0.0');
         SELECT * FROM t6;
     ]], {
         -- <misc1-12.4>
-    0,"0.0"
+    "0","0.0"
         -- </misc1-12.4>
     })
 
 test:do_execsql_test(
     "misc1-12.5",
     [[
-        INSERT OR IGNORE INTO t6 VALUES(0.0,'x');
+        INSERT OR IGNORE INTO t6 VALUES('0','x');
         SELECT * FROM t6;
     ]], {
         -- <misc1-12.5>
-        0, "0.0"
+        "0", "0.0"
         -- </misc1-12.5>
     })
 
@@ -656,7 +656,7 @@ test:do_execsql_test(
         SELECT * FROM t6;
     ]], {
         -- <misc1-12.6>
-    "y","0",0,"0.0"
+    "y","0","0","0.0"
         -- </misc1-12.6>
     })
 
@@ -665,7 +665,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "misc1-12.7",
     [[
-        CREATE TABLE t7(x INTEGER, y TEXT, z primary key);
+        CREATE TABLE t7(x INTEGER, y TEXT, z  INT primary key);
         INSERT INTO t7 VALUES(0,0,1);
         INSERT INTO t7 VALUES(0.0,0,2);
         INSERT INTO t7 VALUES(0,0.0,3);
@@ -730,7 +730,7 @@ if 0>0 then
 test:do_execsql_test(
     "misc1-12.11",
     [[
-        CREATE TABLE t8(x TEXT COLLATE numeric, y INTEGER COLLATE text, z primary key);
+        CREATE TABLE t8(x TEXT COLLATE numeric, y INTEGER COLLATE text, z  INT primary key);
         INSERT INTO t8 VALUES(0,0,1);
         INSERT INTO t8 VALUES(0.0,0,2);
         INSERT INTO t8 VALUES(0,0.0,3);
@@ -771,7 +771,7 @@ end
 test:do_execsql_test(
     "misc1-13.1",
     [[
-        CREATE TABLE t9(x,y primary key);
+        CREATE TABLE t9(x TEXT,y  INT primary key);
         INSERT INTO t9 VALUES('one',1);
         INSERT INTO t9 VALUES('two',2);
         INSERT INTO t9 VALUES('three',3);
@@ -983,7 +983,7 @@ end
 --   CREATE TABLE t19b AS SELECT 4 AS '', 5 AS '',  6 AS '';
 --   SELECT * FROM t19b;
 -- } {4 5 6}
--- # 2015-05-20:  CREATE TABLE AS should not store INT value is a TEXT
+-- # 2015-05-20:  CREATE TABLE AS should not store value is a TEXT
 -- # column.
 -- #
 -- do_execsql_test misc1-19.3 {
@@ -1063,10 +1063,10 @@ test:do_execsql_test(
 -- db close
 -- sqlite3 db :memory:
 -- do_execsql_test misc1-23.1 {
---   CREATE TABLE t1(x);
+--   CREATE TABLE t1(x INT );
 --   UPDATE sqlite_master SET sql='CREATE table t(d CHECK(T(#0)';
 --   BEGIN;
---   CREATE TABLE t2(y);
+--   CREATE TABLE t2(y INT );
 --   ROLLBACK;
 --   DROP TABLE IF EXISTS t3;
 -- } {}
@@ -1076,20 +1076,20 @@ test:do_execsql_test(
 -- database_may_be_corrupt
 -- sqlite3 db :memory:
 -- do_catchsql_test misc1-23.2 {
---   CREATE TABLE t1(x UNIQUE);
+--   CREATE TABLE t1(x  INT UNIQUE);
 --   UPDATE sqlite_master SET sql='CREATE TABLE IF not EXISTS t(c)';
 --   BEGIN;
---   CREATE TABLE t2(x);
+--   CREATE TABLE t2(x INT );
 --   ROLLBACK;
 --   DROP TABLE F;
 -- } {1 {no such table: F}}
 -- db close
 -- sqlite3 db :memory:
 -- do_catchsql_test misc1-23.3 {
---   CREATE TABLE t1(x UNIQUE);
+--   CREATE TABLE t1(x  INT UNIQUE);
 --   UPDATE sqlite_master SET sql='CREATE table y(a TEXT, a TEXT)';
 --   BEGIN;
---   CREATE TABLE t2(y);
+--   CREATE TABLE t2(y INT );
 --   ROLLBACK;
 --   DROP TABLE IF EXISTS t;
 -- } {0 {}}
diff --git a/test/sql-tap/misc3.test.lua b/test/sql-tap/misc3.test.lua
index dc1545f8f..70389a867 100755
--- a/test/sql-tap/misc3.test.lua
+++ b/test/sql-tap/misc3.test.lua
@@ -29,7 +29,7 @@ test:do_test(
     "misc3-1.1",
     function()
         test:execsql([[
-            CREATE TABLE t1(a PRIMARY KEY,b);
+            CREATE TABLE t1(a INT PRIMARY KEY,b TEXT);
             INSERT INTO t1
               VALUES(1,'a23456789_b23456789_c23456789_d23456789_e23456789_');
             UPDATE t1 SET b=b||b;
@@ -39,7 +39,7 @@ test:do_test(
             UPDATE t1 SET b=b||b;
             INSERT INTO t1 VALUES(2,'x');
             UPDATE t1 SET b=substr(b,1,500);
-            CREATE TABLE t2(x PRIMARY KEY,y);
+            CREATE TABLE t2(x  INT PRIMARY KEY,y INT );
             START TRANSACTION;
         ]])
         test:catchsql("UPDATE t1 SET a=CASE a WHEN 2 THEN 1 ELSE a END, b='y';")
@@ -63,7 +63,7 @@ test:do_test(
             DROP TABLE t2;
         ]])
         test:execsql([[
-            CREATE TABLE t1(a PRIMARY KEY,b);
+            CREATE TABLE t1(a INT PRIMARY KEY,b TEXT);
             INSERT INTO t1
             VALUES(1,'a23456789_b23456789_c23456789_d23456789_e23456789_');
             INSERT INTO t1 SELECT a+1, b||b FROM t1;
@@ -329,7 +329,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "misc3-4.1",
     [[
-        CREATE TABLE t3(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t3(a INTEGER PRIMARY KEY, b TEXT);
         INSERT INTO t3 VALUES(1, 'abc');
         INSERT INTO t3 VALUES(2, 'xyz');
         INSERT INTO t3 VALUES(3, NULL);
@@ -374,11 +374,11 @@ test:do_execsql_test(
 test:do_execsql_test(
     "misc3-5.1",
     [[
-        CREATE TABLE x1 (id primary key, b, c);
+        CREATE TABLE x1 (id INT primary key, b TEXT, c INT);
         INSERT INTO x1 VALUES(1, 'dog',3);
         INSERT INTO x1 VALUES(2, 'cat',1);
         INSERT INTO x1 VALUES(3, 'dog',4);
-        CREATE TABLE x2 (c primary key, e);
+        CREATE TABLE x2 (c INT primary key, e TEXT);
         INSERT INTO x2 VALUES(1,'one');
         INSERT INTO x2 VALUES(2,'two');
         INSERT INTO x2 VALUES(3,'three');
@@ -451,9 +451,9 @@ if (0 > 0) then
     test:do_execsql_test(
         "misc3-7.1",
         [[
-            CREATE TABLE y1(a primary key);
-            CREATE TABLE y2(b primary key);
-            CREATE TABLE y3(c primary key);
+            CREATE TABLE y1(a  INT primary key);
+            CREATE TABLE y2(b  INT primary key);
+            CREATE TABLE y3(c  INT primary key);
             START TRANSACTION;
             CREATE TRIGGER r1 AFTER DELETE ON y1 FOR EACH ROW BEGIN
               INSERT INTO y3(c) SELECT b FROM y2 ORDER BY b LIMIT 1;
diff --git a/test/sql-tap/misc5.test.lua b/test/sql-tap/misc5.test.lua
index 7e903d33b..874679cb3 100755
--- a/test/sql-tap/misc5.test.lua
+++ b/test/sql-tap/misc5.test.lua
@@ -32,11 +32,11 @@ for i = 120, 140 - 1, 1 do
         "misc5-1."..i,
         function()
             test:catchsql("DROP TABLE t1")
-            local sql1 = "CREATE TABLE t1 (id primary key,"
+            local sql1 = "CREATE TABLE t1 (id  INT primary key,"
             local sql2 = "INSERT INTO t1 VALUES (1, "
             local sep = ""
             for j = 0, i - 1, 1 do
-                sql1 = sql1 .. string.format("%sa%s", sep, j)
+                sql1 = sql1 .. string.format("%sa%s INT", sep, j)
                 sql2 = sql2 .. string.format("%s%s", sep, j)
                 sep = ","
             end
@@ -53,7 +53,7 @@ end
 -- ifcapable conflict {
 --   do_test misc5-2.1 {
 --     execsql {
---       create table t2(x primary key);
+--       create table t2(x  INT primary key);
 --       insert into t2 values(1);
 --       insert or ignore into t2 select x*2 from t2;
 --       insert or ignore into t2 select x*4 from t2;
@@ -71,8 +71,8 @@ end
 test:do_execsql_test(
     "misc5-2.1",
     [[
-        create table t2(x primary key);
-        create table t2_temp(id primary key, x);
+        create table t2(x  INT primary key);
+        create table t2_temp(id  INT primary key, x INT );
         START TRANSACTION;
         insert into t2_temp values(1, 1);
         insert into t2_temp select id+1,x*2 from t2_temp;
@@ -153,7 +153,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "misc5-3.1",
     [[
-        CREATE TABLE songs(songid primary key, artist, timesplayed);
+        CREATE TABLE songs(songid  INT primary key, artist TEXT, timesplayed INT );
         INSERT INTO songs VALUES(1,'one',1);
         INSERT INTO songs VALUES(2,'one',2);
         INSERT INTO songs VALUES(3,'two',3);
@@ -208,7 +208,7 @@ test:do_execsql_test(
 --     close $fd
 --     sqlite3 db test.db
 --     catchsql {
---       CREATE TABLE t1(a,b,c);
+--       CREATE TABLE t1(a INT ,b INT ,c INT );
 --     }
 --   } {1 {file is encrypted or is not a database}}
 -- }
@@ -288,7 +288,7 @@ test:drop_all_tables()
 test:do_test(
     "misc5-7.1",
     function()
-        test:execsql "CREATE TABLE t1(x primary key)"
+        test:execsql "CREATE TABLE t1(x  INT primary key)"
         sql = "INSERT INTO t1 VALUES("
         tail = ""
         for i = 0, 199, 1 do
@@ -309,10 +309,10 @@ test:do_test(
 -- do_test misc5-7.2 {
 --   sqlite3 db2 :memory:
 --   catchsql {
---     CREATE TABLE t1(x UNIQUE);
+--     CREATE TABLE t1(x  INT UNIQUE);
 --     UPDATE sqlite_master SET sql='CREATE table t(o CHECK(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((;VALUES(o)';
 --     BEGIN;
---     CREATE TABLE t2(y);
+--     CREATE TABLE t2(y INT );
 --     ROLLBACK;
 --     DROP TABLE IF EXISTS D;
 --   } db2
@@ -367,7 +367,7 @@ test:do_test(
     "misc5-11.1",
     function()
         return test:execsql [[
-            CREATE TABLE t3(x primary key);
+            CREATE TABLE t3(x  INT primary key);
             INSERT INTO t3 VALUES(-18);
             INSERT INTO t3 VALUES(-17);
             INSERT INTO t3 VALUES(-16);
diff --git a/test/sql-tap/null.test.lua b/test/sql-tap/null.test.lua
index 5e1f8666e..7179d0d1d 100755
--- a/test/sql-tap/null.test.lua
+++ b/test/sql-tap/null.test.lua
@@ -25,7 +25,7 @@ test:plan(45)
 test:do_execsql_test(
     "null-1.0",
     [[
-        create table t1(a primary key,b,c);
+        create table t1(a  INT primary key,b INT ,c INT );
         START TRANSACTION;
         insert into t1 values(1,0,0);
         insert into t1 values(2,0,1);
@@ -316,7 +316,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "null-7.1",
     [[
-        create table t2(a primary key, b unique);
+        create table t2(a int primary key, b int unique);
         insert into t2 values(1,1);
         insert into t2 values(2,null);
         insert into t2 values(3,null);
@@ -330,7 +330,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "null-7.2",
     [[
-        create table t3(a primary key, b, c, unique(b,c));
+        create table t3(a int primary key, b int, c int, unique(b,c));
         insert into t3 values(1,1,1);
         insert into t3 values(2,null,1);
         insert into t3 values(3,null,1);
@@ -347,7 +347,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "null-8.1",
     [[
-        CREATE TABLE t4(x primary key,y);
+        CREATE TABLE t4(x  INT primary key,y INT );
         INSERT INTO t4 VALUES(1,11);
         INSERT INTO t4 VALUES(2,NULL);
         SELECT x FROM t4 WHERE y=NULL;
@@ -453,7 +453,7 @@ test:do_execsql_test(
     })
 
 -- do_execsql_test null-9.1 {
---   CREATE TABLE t5(a, b, c);
+--   CREATE TABLE t5(a INT , b INT , c INT );
 --   CREATE UNIQUE INDEX t5ab ON t5(a, b);
 --   INSERT INTO t5 VALUES(1, NULL, 'one');
 --   INSERT INTO t5 VALUES(1, NULL, 'i');
diff --git a/test/sql-tap/offset1.test.lua b/test/sql-tap/offset1.test.lua
index e7554ef78..451694af2 100755
--- a/test/sql-tap/offset1.test.lua
+++ b/test/sql-tap/offset1.test.lua
@@ -25,9 +25,9 @@ test:plan(22)
 test:do_execsql_test(
     "offset1-1.1",
     [[
-        CREATE TABLE t1(a primary key,b);
+        CREATE TABLE t1(a INT primary key,b TEXT);
         INSERT INTO t1 VALUES(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
-        CREATE TABLE t2(id primary key, x,y);
+        CREATE TABLE t2(id INT primary key, x INT,y TEXT);
         INSERT INTO t2 VALUES(1, 8,'y'),(2, 9,'z'),(3, 6,'w'),(4, 7,'x');
         SELECT count(*) FROM t1, t2;
     ]], {
diff --git a/test/sql-tap/orderby1.test.lua b/test/sql-tap/orderby1.test.lua
index 1cc104bfc..dc43bf57c 100755
--- a/test/sql-tap/orderby1.test.lua
+++ b/test/sql-tap/orderby1.test.lua
@@ -29,7 +29,7 @@ test:do_test(
     function()
         return test:execsql [[
             CREATE TABLE album(
-              aid PRIMARY KEY,
+              aid INT PRIMARY KEY,
               title TEXT UNIQUE NOT NULL
             );
             CREATE TABLE track(
@@ -417,7 +417,7 @@ test:do_test(
             DROP TABLE track;
             DROP TABLE album;
             CREATE TABLE album(
-              aid PRIMARY KEY,
+              aid INT PRIMARY KEY,
               title TEXT UNIQUE NOT NULL
             );
             CREATE TABLE track(
@@ -664,7 +664,7 @@ test:do_test(
     4.0,
     function()
         return test:execsql [[
-            CREATE TABLE t41(a PRIMARY KEY, b INT NOT NULL);
+            CREATE TABLE t41(a INT PRIMARY KEY, b INT NOT NULL);
             CREATE INDEX t41ba ON t41(b,a);
             CREATE TABLE t42(id INTEGER PRIMARY KEY, x INT NOT NULL REFERENCES t41(a), y INT NOT NULL);
             CREATE UNIQUE INDEX t42xy ON t42(x,y);
@@ -728,7 +728,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     6.0,
     [[
-        CREATE TABLE abc(a primary key, b, c);
+        CREATE TABLE abc(a INT primary key, b INT, c INT);
         INSERT INTO abc VALUES(1, 2, 3);
         INSERT INTO abc VALUES(4, 5, 6);
         INSERT INTO abc VALUES(7, 8, 9);
@@ -751,7 +751,7 @@ test:do_execsql_test(
 -- # routine in where.c.
 -- #
 -- do_execsql_test 7.0 {
---   CREATE TABLE t7(a,b);
+--   CREATE TABLE t7(a INT,b INT);
 --   CREATE INDEX t7a ON t7(a);
 --   CREATE INDEX t7ab ON t7(a,b);
 --   EXPLAIN QUERY PLAN
@@ -767,7 +767,7 @@ test:do_execsql_test(
 --     8.0,
 --     [[
 --         PRAGMA cache_size = 5;
---         CREATE TABLE t1(id integer primary key, a, b);
+--         CREATE TABLE t1(id integer primary key, a INT, b INT);
 --         CREATE INDEX i1 ON t1(a);
 --     ]])
 
diff --git a/test/sql-tap/orderby2.test.lua b/test/sql-tap/orderby2.test.lua
index 6f9933bb5..f7f72cbbb 100755
--- a/test/sql-tap/orderby2.test.lua
+++ b/test/sql-tap/orderby2.test.lua
@@ -27,9 +27,9 @@ test:do_test(
     1.0,
     function()
         return test:execsql [[
-            CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
+            CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT );
             INSERT INTO t1 VALUES(1,11), (2,22);
-            CREATE TABLE t2(d, e, PRIMARY KEY(d,e));
+            CREATE TABLE t2(d INT , e TEXT , PRIMARY KEY(d,e));
             INSERT INTO t2 VALUES(10, 'ten'), (11,'eleven'), (12,'twelve'),
                                  (11, 'oneteen');
         ]]
@@ -119,17 +119,17 @@ test:do_test(
     2.0,
     function()
         return test:execsql [[
-            CREATE TABLE t31(a,b, PRIMARY KEY(a,b));
-            CREATE TABLE t32(c,d, PRIMARY KEY(c,d));
-            CREATE TABLE t33(e,f, PRIMARY KEY(e,f));
-            CREATE TABLE t34(g,h, PRIMARY KEY(g,h));
+            CREATE TABLE t31(a INT ,b INT , PRIMARY KEY(a,b));
+            CREATE TABLE t32(c INT ,d INT , PRIMARY KEY(c,d));
+            CREATE TABLE t33(e INT ,f INT , PRIMARY KEY(e,f));
+            CREATE TABLE t34(g INT ,h INT , PRIMARY KEY(g,h));
 
             INSERT INTO t31 VALUES(1,4), (2,3), (1,3);
             INSERT INTO t32 VALUES(4,5), (3,6), (3,7), (4,8);
             INSERT INTO t33 VALUES(5,9), (7,10), (6,11), (8,12), (8,13), (7,14);
             INSERT INTO t34 VALUES(11,20), (10,21), (12,22), (9,23), (13,24),
                                   (14,25), (12,26);
-            SELECT a||','||c||','||e||','||g FROM t31, t32, t33, t34
+            SELECT CAST(a AS TEXT)||','||CAST(c AS TEXT)||','||CAST(e AS TEXT)||','||CAST(g as TEXT) FROM t31, t32, t33, t34
              WHERE c=b AND e=d AND g=f
              ORDER BY a ASC, c ASC, e DESC, g ASC;
         ]]
@@ -143,7 +143,7 @@ test:do_test(
     2.1,
     function()
         return test:execsql [[
-            SELECT a||','||c||','||e||','||g FROM t31, t32, t33, t34
+            SELECT CAST(a AS TEXT)||','||CAST(c AS TEXT)||','||CAST(e AS TEXT)||','||CAST(g AS TEXT) FROM t31, t32, t33, t34
              WHERE c=b AND e=d AND g=f
              ORDER BY +a ASC, +c ASC, +e DESC, +g ASC;
         ]]
@@ -157,7 +157,7 @@ test:do_test(
     2.2,
     function()
         return test:execsql [[
-            SELECT a||','||c||','||e||','||g FROM t31, t32, t33, t34
+            SELECT CAST(a AS TEXT)||','||CAST(c AS TEXT)||','||CAST(e AS TEXT)||','||CAST(g AS TEXT) FROM t31, t32, t33, t34
              WHERE c=b AND e=d AND g=f
              ORDER BY a ASC, c ASC, e ASC, g ASC;
         ]]
diff --git a/test/sql-tap/orderby4.test.lua b/test/sql-tap/orderby4.test.lua
index fb8d3ecc6..a07857d3a 100755
--- a/test/sql-tap/orderby4.test.lua
+++ b/test/sql-tap/orderby4.test.lua
@@ -28,9 +28,9 @@ testprefix = "orderby4"
 test:do_execsql_test(
     "1.1",
     [[
-        CREATE TABLE t1(a, b, PRIMARY KEY(a,b));
+        CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a,b));
         INSERT INTO t1 VALUES(1,1),(1,2);
-        CREATE TABLE t2(x, y, PRIMARY KEY(x,y));
+        CREATE TABLE t2(x INT, y INT, PRIMARY KEY(x,y));
         INSERT INTO t2 VALUES(3,3),(4,4);
         SELECT a, x FROM t1, t2 ORDER BY 1, 2;
     ]], {
@@ -62,10 +62,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "2.1",
     [[
-        CREATE TABLE t3(id primary key, a);
+        CREATE TABLE t3(id INT primary key, a INT);
         INSERT INTO t3 VALUES(1, 1),(2, 1);
         CREATE INDEX t3a ON t3(a);
-        CREATE TABLE t4(id primary key, x);
+        CREATE TABLE t4(id INT primary key, x INT);
         INSERT INTO t4 VALUES(1, 3),(2, 4);
         CREATE INDEX t4x ON t4(x);
         SELECT a, x FROM t3, t4 ORDER BY 1, 2;
diff --git a/test/sql-tap/orderby5.test.lua b/test/sql-tap/orderby5.test.lua
index 2a7f71949..8a423843a 100755
--- a/test/sql-tap/orderby5.test.lua
+++ b/test/sql-tap/orderby5.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(11)
+test:plan(10)
 
 --!./tcltestrunner.lua
 -- 2013-06-14
@@ -26,11 +26,11 @@ testprefix = "orderby5"
 test:do_execsql_test(
     1.1,
     [[
-        CREATE TABLE t1(id primary key,a,b,c);
+        CREATE TABLE t1(id INT primary key,a TEXT,b INT,c INT);
         CREATE INDEX t1bc ON t1(b,c);
 
         EXPLAIN QUERY PLAN
-        SELECT DISTINCT a, b, c FROM t1 WHERE a=0;
+        SELECT DISTINCT a, b, c FROM t1 WHERE a='0';
     ]], {
         -- <1.1>
         "~/B-TREE/"
@@ -41,7 +41,7 @@ test:do_execsql_test(
     "1.2.1",
     [[
         EXPLAIN QUERY PLAN
-        SELECT DISTINCT a, c, b FROM t1 WHERE a=0;
+        SELECT DISTINCT a, c, b FROM t1 WHERE a='0';
     ]], {
         -- <1.2.1>
         "~/B-TREE/"
@@ -85,7 +85,7 @@ test:do_execsql_test(
     1.3,
     [[
         EXPLAIN QUERY PLAN
-        SELECT DISTINCT b, a, c FROM t1 WHERE a=0;
+        SELECT DISTINCT b, a, c FROM t1 WHERE a='0';
     ]], {
         -- <1.3>
         "~/B-TREE/"
@@ -96,7 +96,7 @@ test:do_execsql_test(
     1.4,
     [[
         EXPLAIN QUERY PLAN
-        SELECT DISTINCT b, c, a FROM t1 WHERE a=0;
+        SELECT DISTINCT b, c, a FROM t1 WHERE a='0';
     ]], {
         -- <1.4>
         "~/B-TREE/"
@@ -107,7 +107,7 @@ test:do_execsql_test(
     1.5,
     [[
         EXPLAIN QUERY PLAN
-        SELECT DISTINCT c, a, b FROM t1 WHERE a=0;
+        SELECT DISTINCT c, a, b FROM t1 WHERE a='0';
     ]], {
         -- <1.5>
         "~/B-TREE/"
@@ -118,7 +118,7 @@ test:do_execsql_test(
     1.6,
     [[
         EXPLAIN QUERY PLAN
-        SELECT DISTINCT c, b, a FROM t1 WHERE a=0;
+        SELECT DISTINCT c, b, a FROM t1 WHERE a='0';
     ]], {
         -- <1.6>
         "~/B-TREE/"
@@ -142,7 +142,7 @@ test:do_execsql_test(
 -- # lookups.
 -- #
 -- do_execsql_test 2.1a {
---   CREATE TABLE t2(a,b,c);
+--   CREATE TABLE t2(a INT,b INT,c INT);
 --   CREATE INDEX t2bc ON t2(b,c);
 --   ANALYZE;
 --   INSERT INTO sqlite_stat1 VALUES('t1','t1bc','1000000 10 9');
@@ -179,25 +179,25 @@ test:do_execsql_test(
 --   EXPLAIN QUERY PLAN
 --   SELECT * FROM t1 WHERE a=0 ORDER BY c, b, a;
 -- } {/B-TREE/}
-test:do_execsql_test(
-    3.0,
-    [[
-        CREATE TABLE t3(a INTEGER PRIMARY KEY, b, c, d, e, f);
+--test:do_execsql_test(
+--    3.0,
+--    [[
+--        CREATE TABLE t3(a INTEGER PRIMARY KEY, b INT, c INT, d INT, e INT, f INT);
         --CREATE INDEX t3bcde ON t3(b, c, d, e);
         -- As pk is not necessary in Tarantool's secondary indexes 'a' should be added manually
-        CREATE INDEX t3bcde ON t3(b, c, d, e, a);
-        EXPLAIN QUERY PLAN
-        SELECT a FROM t3 WHERE b=2 AND c=3 ORDER BY d DESC, e DESC, b, c, a DESC;
-    ]], {
+--        CREATE INDEX t3bcde ON t3(b, c, d, e, a);
+--        EXPLAIN QUERY PLAN
+--        SELECT a FROM t3 WHERE b=2 AND c=3 ORDER BY d DESC, e DESC, b, c, a DESC;
+--    ]], {
         -- <3.0>
-        "~/B-TREE/"
+--        "~/B-TREE/"
         -- </3.0>
-    })
+--    })
 
 -- MUST_WORK_TEST
 -- do_execsql_test 3.1 {
 --   DROP TABLE t3;
---   CREATE TABLE t3(a INTEGER PRIMARY KEY, b, c, d, e, f);
+--   CREATE TABLE t3(a INTEGER PRIMARY KEY, b INT, c INT, d INT, e INT, f INT);
 --   CREATE INDEX t3bcde ON t3(b, c, d, e);
 --   EXPLAIN QUERY PLAN
 --   SELECT a FROM t3 WHERE b=2 AND c=3 ORDER BY d DESC, e DESC, b, c, a DESC;
diff --git a/test/sql-tap/orderby6.test.lua b/test/sql-tap/orderby6.test.lua
index 1270626a6..746baef95 100755
--- a/test/sql-tap/orderby6.test.lua
+++ b/test/sql-tap/orderby6.test.lua
@@ -32,7 +32,7 @@ testprefix = "orderby6"
     test:do_test(
         "1.1",
         function()
-            test:execsql "CREATE TABLE t1(a,b,c,PRIMARY KEY(b,c));"
+            test:execsql "CREATE TABLE t1(a INT ,b INT ,c INT ,PRIMARY KEY(b,c));"
             return test:execsql [[
                 WITH RECURSIVE
                  cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<1000)
@@ -207,7 +207,7 @@ testprefix = "orderby6"
     test:do_test(
         "1.31",
         function()
-            test:execsql "CREATE TABLE t2(a,b,c,d,e,f,PRIMARY KEY(b,c,d,e,f));"
+            test:execsql "CREATE TABLE t2(a INT ,b INT ,c INT ,d INT ,e INT ,f INT ,PRIMARY KEY(b,c,d,e,f));"
             return test:execsql [[
                 WITH RECURSIVE
                  cnt(x) AS (VALUES(0) UNION ALL SELECT x+1 FROM cnt WHERE x<242)
diff --git a/test/sql-tap/orderby8.test.lua b/test/sql-tap/orderby8.test.lua
index 1651cd9e5..63ec6da1c 100755
--- a/test/sql-tap/orderby8.test.lua
+++ b/test/sql-tap/orderby8.test.lua
@@ -29,7 +29,7 @@ test:do_test(
     1.0,
     function()
         test:execsql [[
-            CREATE TABLE t1(x primary key);
+            CREATE TABLE t1(x INT primary key);
             INSERT INTO t1(x) VALUES(1),(5),(9),(7),(3),(2),(4),(6),(8);
         ]]
         rs = "x"
diff --git a/test/sql-tap/orderby9.test.lua b/test/sql-tap/orderby9.test.lua
index 5d2550eab..33c9a31a4 100755
--- a/test/sql-tap/orderby9.test.lua
+++ b/test/sql-tap/orderby9.test.lua
@@ -27,7 +27,7 @@ test:do_execsql_test(
     "setup",
     [[
         -- create a table with many entries
-        CREATE TABLE t1(x primary key);
+        CREATE TABLE t1(x  INT primary key);
         WITH RECURSIVE
            c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100)
         INSERT INTO t1 SELECT x FROM c;
diff --git a/test/sql-tap/printf2.test.lua b/test/sql-tap/printf2.test.lua
index bc76d241b..dca9137ee 100755
--- a/test/sql-tap/printf2.test.lua
+++ b/test/sql-tap/printf2.test.lua
@@ -174,15 +174,13 @@ test:do_execsql_test(
 test:do_execsql_test(
     "printf2-2.1",
     [[
-        CREATE TABLE t1(id primary key, a,b,c);
+        CREATE TABLE t1(id INT primary key, a INT,b INT,c INT);
         INSERT INTO t1 VALUES(1, 1,2,3);
         INSERT INTO t1 VALUES(2, -1,-2,-3);
-        INSERT INTO t1 VALUES(3, 'abc','def','ghi');
-        INSERT INTO t1 VALUES(4, 1.5,2.25,3.125);
         SELECT printf('(%s)-%n-(%s)',a,b,c) FROM t1 ORDER BY id;
     ]], {
         -- <printf2-2.1>
-        "(1)--(2)", "(-1)--(-2)", "(abc)--(def)", "(1.5)--(2.25)"
+        "(1)--(2)", "(-1)--(-2)"
         -- </printf2-2.1>
     })
 
@@ -194,7 +192,7 @@ test:do_execsql_test(
         SELECT printf('%s=(%p)',a,a) FROM t1 ORDER BY a;
     ]], {
         -- <printf2-2.2>
-        "-1=(FFFFFFFFFFFFFFFF)", "1=(1)", "1.5=(1)", "abc=(0)"
+        "-1=(FFFFFFFFFFFFFFFF)", "1=(1)"
         -- </printf2-2.2>
     })
 
@@ -209,7 +207,7 @@ test:do_execsql_test(
         SELECT printf('%s=(%d/%g/%s)',a) FROM t1 ORDER BY a;
     ]], {
         -- <printf2-2.3>
-        "-1=(0/0/)", "1=(0/0/)", "1.5=(0/0/)", "abc=(0/0/)"
+        "-1=(0/0/)", "1=(0/0/)"
         -- </printf2-2.3>
     })
 
diff --git a/test/sql-tap/randexpr1.test.lua b/test/sql-tap/randexpr1.test.lua
index 7bc2c34c7..cafb853e8 100755
--- a/test/sql-tap/randexpr1.test.lua
+++ b/test/sql-tap/randexpr1.test.lua
@@ -34,7 +34,7 @@ test:do_test(
     "randexpr1-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a PRIMARY KEY,b,c,d,e,f);
+            CREATE TABLE t1(a  INT PRIMARY KEY,b INT ,c INT ,d INT ,e INT ,f INT );
             INSERT INTO t1 VALUES(100,200,300,400,500,600);
             SELECT * FROM t1
         ]]
diff --git a/test/sql-tap/resolver01.test.lua b/test/sql-tap/resolver01.test.lua
index 4e708d08a..d08f95bf6 100755
--- a/test/sql-tap/resolver01.test.lua
+++ b/test/sql-tap/resolver01.test.lua
@@ -33,8 +33,8 @@ test:plan(27)
 test:do_catchsql_test(
     "resolver01-1.1",
     [[
-        CREATE TABLE t1(x primary key, y); INSERT INTO t1 VALUES(11,22);
-        CREATE TABLE t2(y primary key, z); INSERT INTO t2 VALUES(33,44);
+        CREATE TABLE t1(x  INT primary key, y INT ); INSERT INTO t1 VALUES(11,22);
+        CREATE TABLE t2(y  INT primary key, z INT ); INSERT INTO t2 VALUES(33,44);
         SELECT 1 AS y FROM t1, t2 ORDER BY y;
     ]], {
         -- <resolver01-1.1>
@@ -55,7 +55,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "resolver01-1.3",
     [[
-        CREATE TABLE t3(x primary key,y); INSERT INTO t3 VALUES(11,44),(33,22);
+        CREATE TABLE t3(x  INT primary key,y INT ); INSERT INTO t3 VALUES(11,44),(33,22);
         SELECT x AS y FROM t3 ORDER BY y;
     ]], {
         -- <resolver01-1.3>
@@ -310,7 +310,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "resolver01-6.1",
     [[
-        CREATE TABLE t61(name primary key);
+        CREATE TABLE t61(name TEXT primary key);
         SELECT min(name) FROM t61 GROUP BY lower(name);
     ]], {
         -- <resolver01-6.1>
@@ -331,7 +331,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "resolver01-6.3",
     [[
-        CREATE TABLE t63(id primary key, name);
+        CREATE TABLE t63(id  INT primary key, name TEXT);
         INSERT INTO t63 VALUES (1, NULL);
         INSERT INTO t63 VALUES (2, 'abc');
         SELECT count(),
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index 6cfce9a0e..62bfc393c 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -222,17 +222,17 @@ string.format([[
         INSERT INTO test1 VALUES(11,22);
         INSERT INTO test1 VALUES(33,44);
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE t3(id INT, a, b, PRIMARY KEY(id));
+        CREATE TABLE t3(id INT, a TEXT, b TEXT, PRIMARY KEY(id));
         INSERT INTO t3 VALUES(1, 'abc',NULL);
         INSERT INTO t3 VALUES(2, NULL,'xyz');
         INSERT INTO t3 SELECT f1, * FROM test1;
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(id INT, a, b, PRIMARY KEY(id));
+        CREATE TABLE t4(id INT, a INT , b TEXT , PRIMARY KEY(id));
         INSERT INTO t4 VALUES(1, NULL,'%s');
         SELECT * FROM t3;
     ]], long), {
         -- <select1-2.0>
-        1, "abc", "", 2, "", "xyz", 11, 11, 22, 33, 33, 44
+        1, "abc", "", 2, "", "xyz", 11, "11", "22", 33, "33", "44"
         -- </select1-2.0>
     })
 
@@ -308,13 +308,13 @@ test:do_execsql_test(
         -- </select1-2.5.2>
     })
 
-test:do_execsql_test(
+test:do_catchsql_test(
     "select1-2.5.3",
     [[
         SELECT count(*),count(a),count(b) FROM t4 WHERE b=5
     ]], {
         -- <select1-2.5.3>
-        0, 0, 0
+        1, "Can't convert to numeric This is a string that is too big to fit inside a NBFS buffer"
         -- </select1-2.5.3>
     })
 
@@ -359,7 +359,7 @@ test:do_execsql_test(
         SELECT coalesce(min(a),'xyzzy') FROM t3
     ]], {
         -- <select1-2.8.1>
-        11
+        "11"
         -- </select1-2.8.1>
     })
 
@@ -369,7 +369,7 @@ test:do_execsql_test(
         SELECT min(coalesce(a,'xyzzy')) FROM t3
     ]], {
         -- <select1-2.8.2>
-        11
+        "11"
         -- </select1-2.8.2>
     })
 
@@ -570,7 +570,7 @@ test:do_catchsql_test(
 -- MUST_WORK_TEST
 -- do_test select1-2.23 {
 --   execsql {
---     CREATE TABLE tkt2526(a,b,c PRIMARY KEY);
+--     CREATE TABLE tkt2526(a INT ,b INT ,c  INT PRIMARY KEY);
 --     INSERT INTO tkt2526 VALUES('x','y',NULL);
 --     INSERT INTO tkt2526 VALUES('x','z',NULL);
 --   }
@@ -803,7 +803,7 @@ test:do_execsql_test(
     "select1-4.8",
     [[
         DROP TABLE IF EXISTS t5;
-        CREATE TABLE t5(a primary key,b);
+        CREATE TABLE t5(a  INT primary key,b INT );
         INSERT INTO t5 VALUES(1,10);
         INSERT INTO t5 VALUES(2,9);
         SELECT * FROM t5 ORDER BY 1;
@@ -1505,7 +1505,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select1-8.2",
     [[
-        SELECT f1 FROM test1 WHERE ('x' || f1) BETWEEN 'x10' AND 'x20'
+        SELECT f1 FROM test1 WHERE ('x' || cast(f1 as TEXT)) BETWEEN 'x10' AND 'x20'
         ORDER BY f1
     ]], {
         -- <select1-8.2>
@@ -1695,7 +1695,7 @@ test:do_execsql_test(
         SELECT * FROM t3, t4;
     ]], {
         -- <select1-11.1>
-        0, 1, 2, 0, 3, 4
+        0, "1", "2", 0, 3, "4"
         -- </select1-11.1>
     })
 
@@ -1705,7 +1705,7 @@ test:do_execsql_test(
         SELECT * FROM t3, t4;
     ]], {
         -- <select1-11.2.1>
-        0, 1, 2, 0, 3, 4
+        0, "1", "2", 0, 3, "4"
         -- </select1-11.2.1>
     })
 
@@ -1715,7 +1715,7 @@ test:do_execsql2_test(
         SELECT * FROM t3, t4;
     ]], {
         -- <select1-11.2.2>
-        "ID",0,"A",1,"B",2,"ID",0,"A",3,"B",4
+        "ID",0,"A","1","B","2","ID",0,"A",3,"B","4"
         -- </select1-11.2.2>
     })
 
@@ -1725,7 +1725,7 @@ test:do_execsql_test(
         SELECT t3.*, t4.b FROM t3, t4;
     ]], {
         -- <select1-11.4.1>
-        0, 1, 2, 4
+        0, "1", "2", "4"
         -- </select1-11.4.1>
     })
 
@@ -1735,7 +1735,7 @@ test:do_execsql_test(
         SELECT "T3".*, t4.b FROM t3, t4;
     ]], {
         -- <select1-11.4.2>
-        0, 1, 2, 4
+        0, "1", "2", "4"
         -- </select1-11.4.2>
     })
 
@@ -1745,7 +1745,7 @@ test:do_execsql2_test(
         SELECT t3.*, t4.b FROM t3, t4;
     ]], {
         -- <select1-11.5.1>
-        "ID", 0, "A", 1, "B", 2, "B", 4
+        "ID", 0, "A", "1", "B", "2", "B", "4"
         -- </select1-11.5.1>
     })
 
@@ -1755,7 +1755,7 @@ test:do_execsql2_test(
         SELECT x.*, y.b FROM t3 AS x, t4 AS y;
     ]], {
         -- <select1-11.6>
-        "ID", 0, "A", 1, "B", 2, "B", 4
+        "ID", 0, "A", "1", "B", "2", "B", "4"
         -- </select1-11.6>
     })
 
@@ -1765,7 +1765,7 @@ test:do_execsql_test(
         SELECT t3.b, t4.* FROM t3, t4;
     ]], {
         -- <select1-11.7>
-        2, 0, 3, 4
+        "2", 0, 3, "4"
         -- </select1-11.7>
     })
 
@@ -1775,7 +1775,7 @@ test:do_execsql2_test(
         SELECT t3.b, t4.* FROM t3, t4;
     ]], {
         -- <select1-11.8>
-        "B", 2, "ID", 0, "A", 3, "B", 4
+        "B", "2", "ID", 0, "A", 3, "B", "4"
         -- </select1-11.8>
     })
 
@@ -1785,7 +1785,7 @@ test:do_execsql2_test(
         SELECT x.b, y.* FROM t3 AS x, t4 AS y;
     ]], {
         -- <select1-11.9>
-        "B", 2, "ID", 0, "A", 3, "B", 4
+        "B", "2", "ID", 0, "A", 3, "B", "4"
         -- </select1-11.9>
     })
 
@@ -1815,7 +1815,7 @@ test:do_execsql2_test(
             SELECT t3.* FROM t3, (SELECT max(a), max(b) FROM t4)
         ]], {
             -- <select1-11.12>
-            "ID", 0, "A", 1, "B", 2
+            "ID", 0, "A", "1", "B", "2"
             -- </select1-11.12>
         })
 
@@ -1825,7 +1825,7 @@ test:do_execsql2_test(
             SELECT t3.* FROM (SELECT max(a), max(b) FROM t4), t3
         ]], {
             -- <select1-11.13>
-            "ID", 0, "A", 1, "B", 2
+            "ID", 0, "A", "1", "B", "2"
             -- </select1-11.13>
         })
 
@@ -1835,7 +1835,7 @@ test:do_execsql2_test(
             SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) as "tx"
         ]], {
             -- <select1-11.14>
-            "ID", 0, "A", 1, "B", 2, "max(a)", 3, "max(b)", 4
+            "ID", 0, "A", "1", "B", "2", "max(a)", 3, "max(b)", "4"
             -- </select1-11.14>
         })
 
@@ -1845,7 +1845,7 @@ test:do_execsql2_test(
             SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
         ]], {
             -- <select1-11.15>
-            "max(a)", 3, "max(b)", 4, "ID", 0, "A", 1, "B", 2
+            "max(a)", 3, "max(b)", "4", "ID", 0, "A", "1", "B", "2"
             -- </select1-11.15>
         })
 
@@ -1857,7 +1857,7 @@ test:do_execsql2_test(
         SELECT y.* FROM t3 as y, t4 as z
     ]], {
         -- <select1-11.16>
-        "ID", 0, "A", 1, "B", 2
+        "ID", 0, "A", "1", "B", "2"
         -- </select1-11.16>
     })
 
@@ -1910,7 +1910,7 @@ test:do_execsql_test(
             SELECT a,b FROM t3 UNION SELECT 3 as "a", 4 ORDER BY a;
         ]], {
             -- <select1-12.5>
-            1, 2, 3, 4
+            3, 4, "1", "2"
             -- </select1-12.5>
         })
 
@@ -1920,7 +1920,7 @@ test:do_execsql_test(
             SELECT 5, 3, 4 UNION SELECT * FROM t3;
         ]], {
             -- <select1-12.6>
-            0, 1, 2, 5, 3, 4
+            0, "1", "2", 5, 3, 4
             -- </select1-12.6>
         })
 
@@ -1934,7 +1934,7 @@ test:do_execsql_test(
             SELECT * FROM t3 WHERE a=(SELECT 1);
         ]], {
             -- <select1-12.7>
-            0, 1, 2
+            0, "1", "2"
             -- </select1-12.7>
         })
 
@@ -1958,7 +1958,7 @@ test:do_execsql2_test(
         ) ORDER BY x;
     ]], {
         -- <select1-12.9>
-        "X", 1, "X", 3
+        "X", 3, "X", "1"
         -- </select1-12.9>
     })
 
@@ -1970,7 +1970,7 @@ test:do_execsql2_test(
         ) as z ORDER BY x;
     ]], {
         -- <select1-12.10>
-        "X", 1, "X", 3
+        "X", 3, "X", "1"
         -- </select1-12.10>
     })
 
@@ -1984,7 +1984,7 @@ test:do_test(
     function()
         test:execsql [[
             drop table if exists abc;
-            create TABLE abc(a, b, c, PRIMARY KEY(a, b));
+            create TABLE abc(a INT, b INT, c INT, PRIMARY KEY(a, b));
             START TRANSACTION;
             INSERT INTO abc VALUES(1, 1, 1);
         ]]
@@ -2040,7 +2040,7 @@ test:do_test(
         "select1-15.1",
         [[
             DROP TABLE IF EXISTS t1;
-            CREATE TABLE t1(id int primary key,a);
+            CREATE TABLE t1(id int primary key,a INT );
             CREATE INDEX i1 ON t1(a);
             INSERT INTO t1 VALUES(1, 1);
             INSERT INTO t1 VALUES(2, 2);
diff --git a/test/sql-tap/select3.test.lua b/test/sql-tap/select3.test.lua
index d49bb8725..dbc95f0d8 100755
--- a/test/sql-tap/select3.test.lua
+++ b/test/sql-tap/select3.test.lua
@@ -350,7 +350,7 @@ test:do_execsql_test("select3-6.8", [[
 --
 test:do_execsql_test("select3-7.1", [[
   DROP TABLE IF EXISTS t2;
-  CREATE TABLE t2(a primary key,b);
+  CREATE TABLE t2(a  INT primary key,b INT );
   INSERT INTO t2 VALUES(1,2);
   SELECT a, sum(b) FROM t2 WHERE b=5 GROUP BY a;
 ]], {
@@ -377,7 +377,7 @@ test:do_execsql_test("select3-8.1", [[
   DROP TABLE IF EXISTS A;
   CREATE TABLE A (
     A1 DOUBLE,
-    A2 VARCHAR COLLATE "unicode_ci",
+    A2 TEXT,
     A3 DOUBLE,
     id int primary key
   );
diff --git a/test/sql-tap/select4.test.lua b/test/sql-tap/select4.test.lua
index a3a700433..ebe8cd4ca 100755
--- a/test/sql-tap/select4.test.lua
+++ b/test/sql-tap/select4.test.lua
@@ -711,7 +711,7 @@ INSERT INTO t2 VALUES (0, 1), (1, 1), (2, 2), (3, 4), (4, 8), (5, 15);]]
 -- #
 -- do_test select4-7.1 {
 --   execsql {
---     CREATE TABLE t2 AS SELECT log AS 'x', count(*) AS 'y' FROM t1 GROUP BY log;
+--     CREATE TABLE t2 AS SELECT log AS 'x', count INT (*) AS 'y' FROM t1 GROUP BY log;
 --     SELECT * FROM t2 ORDER BY x;
 --   }
 -- } {0 1 1 1 2 2 3 4 4 8 5 15}  
@@ -1045,7 +1045,7 @@ test:do_execsql_test(
     })
 
 test:execsql [[DROP TABLE IF EXISTS t2;
-CREATE TABLE t2 (rowid int primary key, x, y);]]
+CREATE TABLE t2 (rowid int primary key, x INT, y INT);]]
 -- Make sure compound SELECTs with wildly different numbers of columns
 -- do not cause assertion faults due to register allocation issues.
 --
@@ -1261,7 +1261,7 @@ test:do_test(
     "select4-13.1",
     function()
         return test:execsql [[
-            CREATE TABLE t13(id int primary key,a,b);
+            CREATE TABLE t13(id int primary key,a INT,b INT);
             INSERT INTO t13 VALUES(0, 1,1);
             INSERT INTO t13 VALUES(1, 2,1);
             INSERT INTO t13 VALUES(2, 3,1);
@@ -1282,7 +1282,7 @@ test:do_test(
 test:do_execsql_test(
     "select4-14.1",
     [[
-        CREATE TABLE t14(a primary key,b,c);
+        CREATE TABLE t14(a INT primary key,b INT,c INT);
         INSERT INTO t14 VALUES(1,2,3),(4,5,6);
         SELECT * FROM t14 INTERSECT VALUES(3,2,1),(2,3,1),(1,2,3),(2,1,3);
     ]], {
diff --git a/test/sql-tap/select5.test.lua b/test/sql-tap/select5.test.lua
index 7ca25aea8..9c3cd2759 100755
--- a/test/sql-tap/select5.test.lua
+++ b/test/sql-tap/select5.test.lua
@@ -206,7 +206,7 @@ test:do_execsql_test(
     "select5-5.1",
     [[
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t2(id int primary key, a, b, c);
+        CREATE TABLE t2(id int primary key, a INT, b INT, c INT);
         INSERT INTO t2 VALUES(0, 1, 2, 3);
         INSERT INTO t2 VALUES(1, 1, 4, 5);
         INSERT INTO t2 VALUES(2, 6, 4, 7);
@@ -276,7 +276,7 @@ test:do_execsql_test(
     "select5-6.1",
     [[
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE t3(x primary key,y);
+        CREATE TABLE t3(x INT primary key,y INT);
         INSERT INTO t3 VALUES(1,NULL);
         INSERT INTO t3 VALUES(2,NULL);
         INSERT INTO t3 VALUES(3,4);
@@ -291,7 +291,7 @@ test:do_execsql_test(
     "select5-6.2",
     [[
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(id int primary key, x,y,z);
+        CREATE TABLE t4(id int primary key, x INT,y INT,z INT);
         INSERT INTO t4 VALUES(0,1,2,NULL);
         INSERT INTO t4 VALUES(1,2,3,NULL);
         INSERT INTO t4 VALUES(2,3,NULL,5);
@@ -324,8 +324,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t8a;
         DROP TABLE IF EXISTS t8b;
-        CREATE TABLE t8a(id int primary key,a,b);
-        CREATE TABLE t8b(rowid int primary key, x);
+        CREATE TABLE t8a(id int primary key,a TEXT,b INT);
+        CREATE TABLE t8b(rowid int primary key, x INT);
         INSERT INTO t8a VALUES(0, 'one', 1);
         INSERT INTO t8a VALUES(1, 'one', 2);
         INSERT INTO t8a VALUES(2, 'two', 3);
diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index 306e43c97..6fdb4195e 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -28,7 +28,7 @@ test:do_test(
     "select6-1.0",
     function()
         -- MUST_WORK_TEST
-        -- CREATE TABLE t1(x, y);
+        -- CREATE TABLE t1(x INT , y INT );
         return test:execsql [[
             DROP TABLE IF EXISTS t1;
             CREATE TABLE t1 (x int PRIMARY KEY, y int);
@@ -168,7 +168,7 @@ test:do_test(
     "select6-2.0",
     function()
         -- MUST_WORK_TEST
-        -- CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+        -- CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT );
         return test:execsql [[
             DROP TABLE IF EXISTS t2;
             CREATE TABLE t2(a INTEGER PRIMARY KEY, b int);
@@ -677,9 +677,9 @@ test:do_execsql_test(
     "select6-8.1",
     [[
         DROP TABLE IF EXISTS t3;
-        CREATE TABLE t3 (p primary key, q);
+        CREATE TABLE t3 (p  INT primary key, q INT );
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(q primary key, r);
+        CREATE TABLE t4(q  INT primary key, r INT );
         START TRANSACTION;
         INSERT INTO t3 VALUES(1,11);
         INSERT INTO t3 VALUES(2,22);
@@ -900,9 +900,9 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS t;
         DROP TABLE IF EXISTS j;
         DROP TABLE IF EXISTS k;
-        CREATE TABLE t(i primary key,j,k);
-        CREATE TABLE j(l primary key,m);
-        CREATE TABLE k(o primary key);
+        CREATE TABLE t(i  INT primary key,j INT ,k INT );
+        CREATE TABLE j(l  INT primary key,m INT );
+        CREATE TABLE k(o  INT primary key);
     ]])
 
 err = { 1, "SELECTs to the left and right of UNION ALL do not have the same number of result columns" }
@@ -1042,8 +1042,8 @@ test:do_execsql_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(x primary key);
-        CREATE TABLE t2(y primary key, z);
+        CREATE TABLE t1(x  INT primary key);
+        CREATE TABLE t2(y  INT primary key, z INT );
         SELECT ( SELECT y FROM t2 WHERE z = cnt )
           FROM ( SELECT count(*) AS cnt FROM t1 );
     ]], {
diff --git a/test/sql-tap/select7.test.lua b/test/sql-tap/select7.test.lua
index bef204361..a5c55309a 100755
--- a/test/sql-tap/select7.test.lua
+++ b/test/sql-tap/select7.test.lua
@@ -24,7 +24,7 @@ test:do_execsql_test(
     "select7-1.1",
     [[
         drop table if exists t1;
-        create table t1(x primary key);
+        create table t1(x TEXT primary key);
         insert into t1 values('amx');
         insert into t1 values('anx');
         insert into t1 values('amy');
@@ -86,8 +86,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS photo;
         DROP TABLE IF EXISTS tag;
-        CREATE TABLE IF NOT EXISTS photo(pk integer primary key, x);
-        CREATE TABLE IF NOT EXISTS tag(pk integer primary key, fk int, name);
+        CREATE TABLE IF NOT EXISTS photo(pk integer primary key, x INT);
+        CREATE TABLE IF NOT EXISTS tag(pk integer primary key, fk int, name TEXT);
 
         SELECT P.pk from PHOTO P WHERE NOT EXISTS (
              SELECT T2.pk from TAG T2 WHERE T2.fk = P.pk
@@ -126,7 +126,7 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "select7-5.1",
     [[
-        CREATE TABLE t2(a primary key,b);
+        CREATE TABLE t2(a  INT primary key,b INT );
         SELECT 5 IN (SELECT a,b FROM t2);
     ]], {
         -- <select7-5.1>
@@ -266,8 +266,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     8.0,
     [[
-        CREATE TABLE t01(x primary key, y);
-        CREATE TABLE t02(x primary key, y);
+        CREATE TABLE t01(x  INT primary key, y INT );
+        CREATE TABLE t02(x  INT primary key, y INT );
     ]])
 
 test:do_catchsql_test(
diff --git a/test/sql-tap/select8.test.lua b/test/sql-tap/select8.test.lua
index 9d075f697..b67d0a194 100755
--- a/test/sql-tap/select8.test.lua
+++ b/test/sql-tap/select8.test.lua
@@ -23,7 +23,7 @@ test:plan(3)
 -- ["source",[["testdir"],"\/tester.tcl"]]
 test:execsql [[
     DROP TABLE IF EXISTS songs;
-    CREATE TABLE songs(songid primary key, artist, timesplayed);
+    CREATE TABLE songs(songid INT primary key, artist TEXT, timesplayed INT);
     INSERT INTO songs VALUES(1,'one',1);
     INSERT INTO songs VALUES(2,'one',2);
     INSERT INTO songs VALUES(3,'two',3);
diff --git a/test/sql-tap/select9.test.lua b/test/sql-tap/select9.test.lua
index 323304b73..f757ab8f2 100755
--- a/test/sql-tap/select9.test.lua
+++ b/test/sql-tap/select9.test.lua
@@ -136,8 +136,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t1(id primary key, a, b, c);
-        CREATE TABLE t2(id primary key, d, e, f);
+        CREATE TABLE t1(id INT primary key, a INT, b TEXT, c TEXT);
+        CREATE TABLE t2(id INT primary key, d INT, e TEXT, f TEXT);
         START TRANSACTION;
           INSERT INTO t1 VALUES(0, 1,  'one',   'I');
           INSERT INTO t1 VALUES(1, 3,  NULL,    NULL);
@@ -484,8 +484,8 @@ test:do_test(
     "select9-5.1",
     function()
         return test:execsql [[
-            CREATE TABLE t51(x primary key, y);
-            CREATE TABLE t52(x primary key, y);
+            CREATE TABLE t51(x INT primary key, y INT);
+            CREATE TABLE t52(x INT primary key, y INT);
             CREATE VIEW v5 as
                SELECT x, y FROM t51
                UNION ALL
@@ -536,8 +536,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t61;
         DROP TABLE IF EXISTS t62;
-        CREATE TABLE t61(a primary key);
-        CREATE TABLE t62(b primary key);
+        CREATE TABLE t61(a INT primary key);
+        CREATE TABLE t62(b INT primary key);
         INSERT INTO t61 VALUES(111);
         INSERT INTO t62 VALUES(222);
         SELECT a FROM t61 WHERE 0 UNION SELECT b FROM t62;
diff --git a/test/sql-tap/selectA.test.lua b/test/sql-tap/selectA.test.lua
index 367a3f127..9161cba91 100755
--- a/test/sql-tap/selectA.test.lua
+++ b/test/sql-tap/selectA.test.lua
@@ -31,39 +31,39 @@ testprefix = "selectA"
 test:do_execsql_test(
     "selectA-1.0",
     [[
-        CREATE TABLE t1(id primary key, a,b,c COLLATE "unicode_ci");
+        CREATE TABLE t1(id  INT primary key, a INT ,b TEXT,c TEXT COLLATE "unicode_ci");
         INSERT INTO t1 VALUES(1, 1,'a','a');
-        INSERT INTO t1 VALUES(2, 9.9, 'b', 'B');
+        INSERT INTO t1 VALUES(2, 9, 'b', 'B');
         INSERT INTO t1 VALUES(3, NULL, 'C', 'c');
-        INSERT INTO t1 VALUES(4, 'hello', 'd', 'D');
-        INSERT INTO t1 VALUES(5, x'616263', 'e', 'e');
+        INSERT INTO t1 VALUES(4, 4, 'd', 'D');
+        INSERT INTO t1 VALUES(5, -9, 'e', 'e');
         SELECT a,b,c FROM t1;
     ]], {
         -- <selectA-1.0>
-        1, "a", "a", 9.9, "b", "B", "", "C", "c", "hello", "d", "D", "abc", "e", "e"
+        1, "a", "a", 9, "b", "B", "", "C", "c", 4, "d", "D", -9, "e", "e"
         -- </selectA-1.0>
     })
 
 test:do_execsql_test(
     "selectA-1.1",
     [[
-        CREATE TABLE t2(id primary key, x,y,z COLLATE "unicode_ci");
+        CREATE TABLE t2(id  INT primary key, x INT ,y TEXT,z  TEXT COLLATE "unicode_ci");
         INSERT INTO t2 VALUES(1, NULL,'U','u');
-        INSERT INTO t2 VALUES(2, 'mad', 'Z', 'z');
-        INSERT INTO t2 VALUES(3, x'68617265', 'm', 'M');
+        INSERT INTO t2 VALUES(2, 4, 'Z', 'z');
+        INSERT INTO t2 VALUES(3, 4444, 'm', 'M');
         INSERT INTO t2 VALUES(4, 5.2e6, 'X', 'x');
         INSERT INTO t2 VALUES(5, -23, 'Y', 'y');
         SELECT x,y,z FROM t2;
     ]], {
         -- <selectA-1.1>
-        "", "U", "u", "mad", "Z", "z", "hare", "m", "M", 5200000.0, "X", "x", -23, "Y", "y"
+        "", "U", "u", 4, "Z", "z", 4444, "m", "M", 5200000, "X", "x", -23, "Y", "y"
         -- </selectA-1.1>
     })
 
 test:do_execsql_test(
     "selectA-1.2",
     [[
-        CREATE TABLE t3(id primary key, a,b,c COLLATE "unicode_ci");
+        CREATE TABLE t3(id  INT primary key, a INT ,b TEXT ,c  TEXT COLLATE "unicode_ci");
         INSERT INTO t3 SELECT id, a, b, c FROM t1;
         INSERT INTO t3 SELECT id+10, x, y, z FROM t2;
         INSERT INTO t3 SELECT id+20, a, b, c FROM t1;
@@ -88,7 +88,7 @@ test:do_execsql_test(
         ORDER BY a,b,c
     ]], {
         -- <selectA-2.1>
-        "", "C", "c", "", "U", "u", -23, "Y", "y", 1, "a", "a", 9.9, "b", "B", 5200000.0, "X", "x", "hello", "d", "D", "mad", "Z", "z", "abc", "e", "e", "hare", "m", "M"
+        "","C","c","","U","u",-23,"Y","y",1,"a","a",4,"Z","z",9,"b","B",4444,"m","M",5200000,"X","x"
         -- </selectA-2.1>
     })
 
@@ -102,7 +102,7 @@ test:do_test(
         ]]
     end, {
         -- <selectA-2.1.1>
-        "", "C", "c", "", "U", "u", -23, "Y", "y", 1, "a", "a", 9.9, "b", "B", 5200000.0, "X", "x", "hello", "d", "D", "mad", "Z", "z", "abc", "e", "e", "hare", "m", "M"
+        "","C","c","","U","u",-23,"Y","y",1,"a","a",4,"Z","z",9,"b","B",4444,"m","M",5200000,"X","x"
         -- </selectA-2.1.1>
     })
 
@@ -116,7 +116,7 @@ test:do_test(
         ]]
     end, {
         -- <selectA-2.1.2>
-        "", "C", "c", "", "U", "u", -23, "Y", "y", 1, "a", "a", 9.9, "b", "B", 5200000.0, "X", "x", "hello", "d", "D", "mad", "Z", "z", "abc", "e", "e", "hare", "m", "M"
+        5200000,"X","x",4444,"m","M",9,"b","B",4,"Z","z",1,"a","a",-23,"Y","y","","C","c","","U","u"
         -- </selectA-2.1.2>
     })
 
@@ -127,7 +127,7 @@ test:do_execsql_test(
         ORDER BY a DESC,b,c
     ]], {
         -- <selectA-2.2>
-        "hare", "m", "M", "abc", "e", "e", "mad", "Z", "z", "hello", "d", "D", 5200000.0, "X", "x", 9.9, "b", "B", 1, "a", "a", -23, "Y", "y", "", "C", "c", "", "U", "u"
+        5200000,"X","x",4444,"m","M",9,"b","B",4,"Z","z",1,"a","a",-23,"Y","y","","C","c","","U","u"
         -- </selectA-2.2>
     })
 
@@ -138,7 +138,7 @@ test:do_execsql_test(
         ORDER BY a,c,b
     ]], {
         -- <selectA-2.3>
-        "", "C", "c", "", "U", "u", -23, "Y", "y", 1, "a", "a", 9.9, "b", "B", 5200000.0, "X", "x", "hello", "d", "D", "mad", "Z", "z", "abc", "e", "e", "hare", "m", "M"
+        "","C","c","","U","u",-23,"Y","y",1,"a","a",4,"Z","z",9,"b","B",4444,"m","M",5200000,"X","x"
         -- </selectA-2.3>
     })
 
@@ -149,7 +149,7 @@ test:do_execsql_test(
         ORDER BY b,a,c
     ]], {
         -- <selectA-2.4>
-        "", "C", "c", "", "U", "u", 5200000.0, "X", "x", -23, "Y", "y", "mad", "Z", "z", 1, "a", "a", 9.9, "b", "B", "hello", "d", "D", "abc", "e", "e", "hare", "m", "M"
+        "","C","c","","U","u",5200000,"X","x",-23,"Y","y",4,"Z","z",1,"a","a",9,"b","B",4444,"m","M"
         -- </selectA-2.4>
     })
 
@@ -160,7 +160,7 @@ test:do_execsql_test(
         ORDER BY b COLLATE "unicode_ci",a,c
     ]], {
         -- <selectA-2.5>
-        1, "a", "a", 9.9, "b", "B", "", "C", "c", "hello", "d", "D", "abc", "e", "e", "hare", "m", "M", "", "U", "u", 5200000.0, "X", "x", -23, "Y", "y", "mad", "Z", "z"
+        "","C","c","","U","u",5200000,"X","x",-23,"Y","y",4,"Z","z",1,"a","a",9,"b","B",4444,"m","M"
         -- </selectA-2.5>
     })
 
@@ -2370,8 +2370,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t4;
         DROP TABLE IF EXISTS t5;
-        CREATE TABLE t4(id int primary key, a int, b);
-        CREATE TABLE t5(id int primary key, c int, d);
+        CREATE TABLE t4(id int primary key, a int, b INT );
+        CREATE TABLE t5(id int primary key, c int, d INT );
 
         INSERT INTO t5 VALUES(0, 1, 'x');
         INSERT INTO t5 VALUES(1, 2, 'x');
@@ -2419,8 +2419,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t6;
         DROP TABLE IF EXISTS t7;
-        CREATE TABLE t6(id int primary key, a, b);
-        CREATE TABLE t7(id int primary key, c, d);
+        CREATE TABLE t6(id int primary key, a INT , b INT );
+        CREATE TABLE t7(id int primary key, c INT , d INT );
 
         INSERT INTO t7 VALUES(0, 2, 9);
         INSERT INTO t6 VALUES(0, 3, 0);
@@ -2472,8 +2472,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t8;
         DROP TABLE IF EXISTS t9;
-        CREATE TABLE t8(id int primary key, a, b);
-        CREATE TABLE t9(id int primary key, c, d);
+        CREATE TABLE t8(id int primary key, a INT , b INT );
+        CREATE TABLE t9(id int primary key, c INT , d INT );
     ]], {
         -- <5.0>
         
diff --git a/test/sql-tap/selectC.test.lua b/test/sql-tap/selectC.test.lua
index 407d2d2b1..1f9c53d27 100755
--- a/test/sql-tap/selectC.test.lua
+++ b/test/sql-tap/selectC.test.lua
@@ -23,7 +23,7 @@ test:do_execsql_test(
     "selectC-1.1",
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(id PRIMARY KEY, a, b, c);
+        CREATE TABLE t1(id  INT PRIMARY KEY, a INT, b TEXT, c TEXT);
         INSERT INTO t1 VALUES(1, 1,'aaa','bbb');
         INSERT INTO t1 VALUES(2, 1, 'aaa', 'bbb');
         INSERT INTO t1 VALUES(3, 2,'ccc','ddd');
@@ -254,9 +254,9 @@ test:do_execsql_test(
 -- ifcapable trigger&&compound {
 --   do_test selectC-2.1 {
 --     catchsql {
---       CREATE TABLE t21a(a,b);
+--       CREATE TABLE t21a(a INT ,b INT );
 --       INSERT INTO t21a VALUES(1,2);
---       CREATE TABLE t21b(n);
+--       CREATE TABLE t21b(n INT );
 --       CREATE TRIGGER r21 AFTER INSERT ON t21b BEGIN
 --         SELECT a FROM t21a WHERE a>new.x UNION ALL
 --         SELECT b FROM t21a WHERE b>new.x ORDER BY 1 LIMIT 2;
@@ -275,7 +275,7 @@ test:do_execsql_test(
 --         org_id          TEXT NOT NULL,
 --         nickname        TEXT NOT NULL,
 --         license         TEXT,
---         CONSTRAINT person_pk PRIMARY KEY (org_id, nickname),
+--         CONSTRAINT person_pk PRIMARY KEY (org_id, nickname INT ),
 --         CONSTRAINT person_license_uk UNIQUE (license)
 --     );
 --     INSERT INTO person VALUES('meyers', 'jack', '2GAT123');
@@ -300,7 +300,7 @@ test:do_execsql_test(
     "selectC-3.2",
     [[
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t2(a PRIMARY KEY, b);
+        CREATE TABLE t2(a  TEXT PRIMARY KEY, b TEXT);
         INSERT INTO t2 VALUES('abc', 'xxx');
         INSERT INTO t2 VALUES('def', 'yyy');
         SELECT a, max(b || a) FROM t2 WHERE (b||b||b)!='value' GROUP BY a;
@@ -331,7 +331,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "selectC-4.1",
     [[
-        create table t_distinct_bug (id int primary key, a, b, c);
+        create table t_distinct_bug (id int primary key, a TEXT, b TEXT, c TEXT);
         insert into t_distinct_bug values (0, '1', '1', 'a');
         insert into t_distinct_bug values (1, '1', '2', 'b');
         insert into t_distinct_bug values (2, '1', '3', 'c');
diff --git a/test/sql-tap/selectE.test.lua b/test/sql-tap/selectE.test.lua
index 964a1bcd5..11b84711e 100755
--- a/test/sql-tap/selectE.test.lua
+++ b/test/sql-tap/selectE.test.lua
@@ -29,9 +29,9 @@ test:plan(7)
 -- easily tell where the output of one query ends and the next query
 -- begins. 
 -- 
---     CREATE TABLE t1(a);
+--     CREATE TABLE t1(a TEXT);
 --     INSERT INTO t1 VALUES('abc'),('def');
---     CREATE TABLE t2(a);
+--     CREATE TABLE t2(a TEXT);
 --     INSERT INTO t2 VALUES('DEF');
 -- 
 --     SELECT a FROM t1 EXCEPT SELECT a FROM t2 ORDER BY a;
@@ -50,11 +50,11 @@ test:do_test(
     "selectE-1.0",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a primary key);
+            CREATE TABLE t1(a TEXT primary key);
             INSERT INTO t1 VALUES('abc'),('def'),('ghi');
-            CREATE TABLE t2(a primary key);
+            CREATE TABLE t2(a TEXT primary key);
             INSERT INTO t2 VALUES('DEF'),('abc');
-            CREATE TABLE t3(a primary key);
+            CREATE TABLE t3(a TEXT primary key);
             INSERT INTO t3 VALUES('def'),('jkl');
 
             SELECT a FROM t1 EXCEPT SELECT a FROM t2
diff --git a/test/sql-tap/selectF.test.lua b/test/sql-tap/selectF.test.lua
index a28fe5d37..4cc5af137 100755
--- a/test/sql-tap/selectF.test.lua
+++ b/test/sql-tap/selectF.test.lua
@@ -24,8 +24,8 @@ testprefix = "selectF"
 test:do_execsql_test(
     1,
     [[
-        CREATE TABLE t1(a primary key, b, c);
-        CREATE TABLE t2(d primary key, e, f);
+        CREATE TABLE t1(a INT primary key, b TEXT, c TEXT);
+        CREATE TABLE t2(d INT primary key, e TEXT, f TEXT);
         START TRANSACTION;
         INSERT INTO t1 VALUES(1,'one','I');
         INSERT INTO t2 VALUES(5,'ten','XX');
diff --git a/test/sql-tap/selectG.test.lua b/test/sql-tap/selectG.test.lua
index c9ee7de35..69029023f 100755
--- a/test/sql-tap/selectG.test.lua
+++ b/test/sql-tap/selectG.test.lua
@@ -34,7 +34,7 @@ local time_quota =
 test:do_test(
     100,
     function()
-        local sql_arr = {[[CREATE TABLE t1(x primary key);
+        local sql_arr = {[[CREATE TABLE t1(x INT primary key);
             INSERT INTO t1(x) VALUES]]}
         local i
         for i = 1, 100000-1, 1 do
diff --git a/test/sql-tap/sort.test.lua b/test/sql-tap/sort.test.lua
index 436af4bbc..240c7db58 100755
--- a/test/sql-tap/sort.test.lua
+++ b/test/sql-tap/sort.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(69)
+test:plan(62)
 
 --!./tcltestrunner.lua
 -- 2001 September 15.
@@ -294,7 +294,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "sort-3.1",
     [[
-        CREATE TABLE t2(a,b PRIMARY KEY);
+        CREATE TABLE t2(a TEXT ,b  INT PRIMARY KEY);
         INSERT INTO t2 VALUES('AGLIENTU',1);
         INSERT INTO t2 VALUES('AGLIE`',2);
         INSERT INTO t2 VALUES('AGNA',3);
@@ -433,7 +433,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "sort-5.1",
     [[
-        create table t3(id primary key, a,b);
+        create table t3(id  INT primary key, a INT ,b TEXT);
         insert into t3 values(1, 5,NULL);
         insert into t3 values(2, 6,NULL);
         insert into t3 values(3, 3,NULL);
@@ -663,84 +663,6 @@ test:do_execsql_test(
         -- </sort-8.1>
     })
 
--- BLOBs should sort after TEXT
---
-test:do_execsql_test(
-    "sort-9.1",
-    [[
-        CREATE TABLE t6(x PRIMARY KEY, y);
-        INSERT INTO t6 VALUES(1,1);
-        INSERT INTO t6 VALUES(2,'1');
-        INSERT INTO t6 VALUES(3,x'31');
-        INSERT INTO t6 VALUES(4,NULL);
-        SELECT x FROM t6 ORDER BY y;
-    ]], {
-        -- <sort-9.1>
-        4, 1, 2, 3
-        -- </sort-9.1>
-    })
-
-test:do_execsql_test(
-    "sort-9.2",
-    [[
-        SELECT x FROM t6 ORDER BY y DESC;
-    ]], {
-        -- <sort-9.2>
-        3, 2, 1, 4
-        -- </sort-9.2>
-    })
-
-test:do_execsql_test(
-    "sort-9.3",
-    [[
-        SELECT x FROM t6 WHERE y<1
-    ]], {
-        -- <sort-9.3>
-        
-        -- </sort-9.3>
-    })
-
-test:do_execsql_test(
-    "sort-9.4",
-    [[
-        SELECT x FROM t6 WHERE y<'1'
-    ]], {
-        -- <sort-9.4>
-        1
-        -- </sort-9.4>
-    })
-
-test:do_execsql_test(
-    "sort-9.5",
-    [[
-        SELECT x FROM t6 WHERE y<x'31'
-    ]], {
-        -- <sort-9.5>
-        1, 2
-        -- </sort-9.5>
-    })
-
-test:do_execsql_test(
-    "sort-9.6",
-    [[
-        SELECT x FROM t6 WHERE y>1
-    ]], {
-        -- <sort-9.6>
-        2, 3
-        -- </sort-9.6>
-    })
-
-test:do_execsql_test(
-    "sort-9.7",
-    [[
-        SELECT x FROM t6 WHERE y>'1'
-    ]], {
-        -- <sort-9.7>
-        3
-        -- </sort-9.7>
-    })
-
-
 
 -- endif bloblit
 -- Ticket #1092 - ORDER BY on rowid fields.
@@ -785,10 +707,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "sort-11.1",
     [[
-        create table t8(a PRIMARY KEY, b, c);
+        create table t8(a  INT PRIMARY KEY, b INT , c INT );
         insert into t8 values(1,2,3);
         insert into t8 values(2,3,4);
-        create table t9(id primary key, x,y);
+        create table t9(id  INT primary key, x INT ,y INT );
         insert into t9 values(1, 2,4);
         insert into t9 values(2, 2,3);
         select y from t8, t9 where a=1 order by a, y;
@@ -806,13 +728,13 @@ test:do_execsql_test(
     "sort-12.1",
     [[
         create table a (id integer primary key);
-        create table b (id integer primary key, aId integer, text);
+        create table b (id integer primary key, aId integer, "text" text);
         insert into a values (1);
         insert into b values (2, 1, 'xxx');
         insert into b values (1, 1, 'zzz');
         insert into b values (3, 1, 'yyy');
-        select a.id, b.id, b.text from a join b on (a.id = b.aId)
-          order by a.id, b.text;
+        select a.id, b.id, b."text" from a join b on (a.id = b.aId)
+          order by a.id, b."text";
     ]], {
         -- <sort-12.1>
         1, 2, "xxx", 1, 3, "yyy", 1, 1, "zzz"
@@ -825,7 +747,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "sort-13.0",
     [[
-        CREATE TABLE t10(id primary key, a, b);
+        CREATE TABLE t10(id  INT primary key, a INT , b INT );
     ]])
 
 test:do_test(
@@ -874,7 +796,7 @@ box.internal.sql_create_function("cksum", cksum)
     test:do_execsql_test(
         "sort-14.0",
         [[
-            CREATE TABLE t11(a, b);
+            CREATE TABLE t11(a INT , b INT );
             INSERT INTO t11 VALUES(randomblob(5000), NULL);
             INSERT INTO t11 SELECT randomblob(5000), NULL FROM t11; --2
             INSERT INTO t11 SELECT randomblob(5000), NULL FROM t11; --3
@@ -940,7 +862,7 @@ box.internal.sql_create_function("cksum", cksum)
         test:do_execsql_test(
             "15."..tn..".2",
             [[
-                CREATE TABLE t1(a primary key);
+                CREATE TABLE t1(a  INT primary key);
                 INSERT INTO t1 VALUES(4);
                 INSERT INTO t1 VALUES(5);
                 INSERT INTO t1 VALUES(3);
@@ -979,7 +901,7 @@ box.internal.sql_create_function("cksum", cksum)
     test:do_catchsql_test(
         16.1,
         [[
-            CREATE TABLE t1(a, b, c);
+            CREATE TABLE t1(a INT , b INT , c INT );
             INSERT INTO t1 VALUES(1, 2, 3);
             INSERT INTO t1 VALUES(1, NULL, 3);
             INSERT INTO t1 VALUES(NULL, 2, 3);
@@ -996,7 +918,7 @@ box.internal.sql_create_function("cksum", cksum)
     test:do_catchsql_test(
         16.2,
         [[
-            CREATE TABLE t1(a, b, c);
+            CREATE TABLE t1(a INT , b INT , c INT );
             INSERT INTO t1 VALUES(1, 2, 3);
             INSERT INTO t1 VALUES(1, NULL, 3);
             INSERT INTO t1 VALUES(1, 2, 3);
diff --git a/test/sql-tap/subquery.test.lua b/test/sql-tap/subquery.test.lua
index fb1c23c0b..49255ea59 100755
--- a/test/sql-tap/subquery.test.lua
+++ b/test/sql-tap/subquery.test.lua
@@ -26,8 +26,8 @@ test:do_test(
     "subquery-1.1",
     function()
         test:execsql [[
-            CREATE TABLE t1(a PRIMARY KEY,b);
-            CREATE TABLE t2(x PRIMARY KEY,y);
+            CREATE TABLE t1(a  INT PRIMARY KEY,b INT );
+            CREATE TABLE t2(x  INT PRIMARY KEY,y INT );
             START TRANSACTION;
             INSERT INTO t1 VALUES(1,2);
             INSERT INTO t1 VALUES(3,4);
@@ -244,7 +244,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "subquery-2.2.1",
     [[
-        CREATE TABLE t3(a PRIMARY KEY, b);
+        CREATE TABLE t3(a  INT PRIMARY KEY, b INT );
         INSERT INTO t3 VALUES(1, 2);
         INSERT INTO t3 VALUES(3, 1);
     ]], {
@@ -413,10 +413,10 @@ test:do_test(
         test:catchsql " DROP TABLE t1; "
         test:catchsql " DROP TABLE t2; "
         return test:execsql [[
-            CREATE TABLE t1(a PRIMARY KEY,b);
+            CREATE TABLE t1(a  INT PRIMARY KEY,b INT );
             INSERT INTO t1 VALUES(1,2);
             CREATE VIEW v1 AS SELECT b FROM t1 WHERE a>0;
-            CREATE TABLE t2(p PRIMARY KEY,q);
+            CREATE TABLE t2(p  INT PRIMARY KEY,q INT );
             INSERT INTO t2 VALUES(2,9);
             SELECT * FROM v1 WHERE EXISTS(SELECT * FROM t2 WHERE p=v1.b);
         ]]
@@ -443,7 +443,7 @@ test:do_test(
     "subquery-3.2",
     function()
         test:catchsql [[
-            CREATE TABLE t1(a PRIMARY KEY,b);
+            CREATE TABLE t1(a  INT PRIMARY KEY,b INT );
             INSERT INTO t1 VALUES(1,2);
         ]]
         return test:execsql [[
@@ -474,7 +474,7 @@ test:do_test(
     function()
         test:catchsql "DROP TABLE t2"
         return test:execsql [[
-            CREATE TABLE t2(c PRIMARY KEY, d);
+            CREATE TABLE t2(c  INT PRIMARY KEY, d TEXT);
             INSERT INTO t2 VALUES(1, 'one');
             INSERT INTO t2 VALUES(2, 'two');
             SELECT a, (SELECT d FROM t2 WHERE a=c) FROM t1 GROUP BY a;
@@ -522,7 +522,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "subquery-3.4.1",
     [[
-        CREATE TABLE t34(id primary key, x,y);
+        CREATE TABLE t34(id  INT primary key, x INT ,y INT );
         INSERT INTO t34 VALUES(1, 106,4), (2, 107,3), (3, 106,5), (4, 107,5);
         SELECT a.x, avg(a.y)
           FROM t34 AS a
@@ -579,8 +579,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "subquery-3.5.1",
     [[
-        CREATE TABLE t35a(x PRIMARY KEY); INSERT INTO t35a VALUES(1),(2),(3);
-        CREATE TABLE t35b(y PRIMARY KEY); INSERT INTO t35b VALUES(98), (99);
+        CREATE TABLE t35a(x  INT PRIMARY KEY); INSERT INTO t35a VALUES(1),(2),(3);
+        CREATE TABLE t35b(y  INT PRIMARY KEY); INSERT INTO t35b VALUES(98), (99);
         SELECT max((SELECT avg(y) FROM t35b)) FROM t35a;
     ]], {
         -- <subquery-3.5.1>
@@ -681,7 +681,7 @@ test:do_test(
     "subquery-4.2.1",
     function()
         test:execsql [[
-            CREATE TABLE t3(a PRIMARY KEY);
+            CREATE TABLE t3(a  INT PRIMARY KEY);
             INSERT INTO t3 VALUES(10);
         ]]
         return test:execsql "INSERT INTO t3 VALUES((SELECT max(a) FROM t3)+1)"
@@ -722,12 +722,12 @@ test:do_test(
         callcnt = 0
         box.internal.sql_create_function("callcnt", "INT", callcntproc)
         return test:execsql [[
-            CREATE TABLE t4(x,y PRIMARY KEY);
+            CREATE TABLE t4(x TEXT,y  INT PRIMARY KEY);
             INSERT INTO t4 VALUES('one',1);
             INSERT INTO t4 VALUES('two',2);
             INSERT INTO t4 VALUES('three',3);
             INSERT INTO t4 VALUES('four',4);
-            CREATE TABLE t5(a PRIMARY KEY,b);
+            CREATE TABLE t5(a  INT PRIMARY KEY,b INT );
             INSERT INTO t5 VALUES(1,11);
             INSERT INTO t5 VALUES(2,22);
             INSERT INTO t5 VALUES(3,33);
@@ -798,15 +798,15 @@ test:do_test(
 test:do_execsql_test(
     "subquery-7.1",
     [[
-        CREATE TABLE t7(c7 PRIMARY KEY);
+        CREATE TABLE t7(c7  INT PRIMARY KEY);
         INSERT INTO t7 VALUES(1);
         INSERT INTO t7 VALUES(2);
         INSERT INTO t7 VALUES(3);
-        CREATE TABLE t8(c8 PRIMARY KEY);
+        CREATE TABLE t8(c8  INT PRIMARY KEY);
         INSERT INTO t8 VALUES(100);
         INSERT INTO t8 VALUES(200);
         INSERT INTO t8 VALUES(300);
-        CREATE TABLE t9(c9 PRIMARY KEY);
+        CREATE TABLE t9(c9  INT PRIMARY KEY);
         INSERT INTO t9 VALUES(10000);
         INSERT INTO t9 VALUES(20000);
         INSERT INTO t9 VALUES(30000);
diff --git a/test/sql-tap/subquery2.test.lua b/test/sql-tap/subquery2.test.lua
index db3a31729..240911f4d 100755
--- a/test/sql-tap/subquery2.test.lua
+++ b/test/sql-tap/subquery2.test.lua
@@ -26,9 +26,9 @@ test:do_test(
     "subquery2-1.1",
     function()
         test:execsql [[
-            CREATE TABLE t1(a PRIMARY KEY,b);
-            CREATE TABLE t2(c PRIMARY KEY,d);
-            CREATE TABLE t3(e PRIMARY KEY,f);
+            CREATE TABLE t1(a  INT PRIMARY KEY,b INT );
+            CREATE TABLE t2(c  INT PRIMARY KEY,d INT );
+            CREATE TABLE t3(e  INT PRIMARY KEY,f INT );
             START TRANSACTION;
             INSERT INTO t1 VALUES(1,2);
             INSERT INTO t1 VALUES(3,4);
@@ -117,8 +117,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     2.1,
     [[
-        CREATE TABLE t4(a PRIMARY KEY, b);
-        CREATE TABLE t5(a PRIMARY KEY, b);
+        CREATE TABLE t4(a  INT PRIMARY KEY, b INT );
+        CREATE TABLE t5(a  INT PRIMARY KEY, b INT );
         INSERT INTO t5 VALUES(3, 5);
 
         INSERT INTO t4 VALUES(1, 1);
diff --git a/test/sql-tap/suite.ini b/test/sql-tap/suite.ini
index 2455f5e8d..5ddab1e73 100644
--- a/test/sql-tap/suite.ini
+++ b/test/sql-tap/suite.ini
@@ -1,6 +1,11 @@
 [default]
 core = app
 description = Database tests with #! using TAP
+disabled = selectA.test.lua ;
+           like2.test.lua ;
+           delete1.test.lua ; Disabled until SQL DD integration is finished
+           types2.test.lua ;
+           e_expr.test.lua ;
 lua_libs = lua/sqltester.lua ../sql/lua/sql_tokenizer.lua ../box/lua/identifier.lua
 is_parallel = True
 release_disabled = debug_mode_only.test.lua
diff --git a/test/sql-tap/table.test.lua b/test/sql-tap/table.test.lua
index 13e495eda..8367ec016 100755
--- a/test/sql-tap/table.test.lua
+++ b/test/sql-tap/table.test.lua
@@ -148,7 +148,7 @@ test:do_test(
 test:do_catchsql_test(
     "table-2.1d",
     [[
-        CREATE TABLE IF NOT EXISTS test2(x primary key,y)
+        CREATE TABLE IF NOT EXISTS test2(x INT primary key,y INT)
     ]], {
         -- <table-2.1d>
         0
@@ -158,7 +158,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "table-2.1e",
     [[
-        CREATE TABLE IF NOT EXISTS test2(x UNIQUE, y TEXT PRIMARY KEY)
+        CREATE TABLE IF NOT EXISTS test2(x INT UNIQUE, y TEXT PRIMARY KEY)
     ]], {
         -- <table-2.1e>
         0
@@ -180,7 +180,7 @@ test:do_execsql_test(
 test:do_test(
     "table-2.2a",
     function()
-        test:execsql "CREATE TABLE test2(id primary key, one text)"
+        test:execsql "CREATE TABLE test2(id INT primary key, one text)"
         return test:execsql "CREATE INDEX test3 ON test2(one)"
         --catchsql {CREATE TABLE test3(id primary key, two text)}
     end, {
@@ -263,7 +263,7 @@ test:do_test(
 test:do_catchsql_test(
     "table-3.2",
     [[
-        CREATE TABLE BIG(xyz foo primary key)
+        CREATE TABLE BIG(xyz int primary key)
     ]], {
         -- <table-3.2>
         1, "table BIG already exists"
@@ -273,7 +273,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "table-3.3",
     [[
-        CREATE TABLE biG(xyz foo primary key)
+        CREATE TABLE biG(xyz int primary key)
     ]], {
         -- <table-3.3>
         1, "table BIG already exists"
@@ -283,7 +283,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "table-3.4",
     [[
-        CREATE TABLE bIg(xyz foo primary key)
+        CREATE TABLE bIg(xyz int primary key)
     ]], {
         -- <table-3.4>
         1, "table BIG already exists"
@@ -317,7 +317,7 @@ test:do_test(
     "table-4.1",
     function()
         for i = 1, 100, 1 do
-            local sql = "CREATE TABLE "..string.format("test%03d", i).." (id primary key, "
+            local sql = "CREATE TABLE "..string.format("test%03d", i).." (id INT primary key, "
             for k = 1, i-1, 1 do
                 sql = sql .. "field"..k.." text,"
             end
@@ -489,14 +489,14 @@ test:do_catchsql_test(
     "table-7.1",
     [=[
         CREATE TABLE weird(
-          id primary key,
+          id int primary key,
           "desc" text,
           "asc" text,
           key int,
-          "14_vac" boolean,
+          "14_vac" int,
           fuzzy_dog_12 varchar(10),
           beginn blob,
-          endd clob
+          endd blob
         )
     ]=], {
         -- <table-7.1>
@@ -528,7 +528,7 @@ test:do_execsql2_test(
 test:do_execsql_test(
     "table-7.3",
     [[
-        CREATE TABLE savepoint_t(release_t primary key);
+        CREATE TABLE savepoint_t(release_t int primary key);
         INSERT INTO savepoint_t(release_t) VALUES(10);
         UPDATE savepoint_t SET release_t = 5;
         SELECT release_t FROM savepoint_t;
@@ -545,14 +545,14 @@ test:do_execsql2_test(
     [=[
         --CREATE TABLE t2 AS SELECT * FROM weird;
         CREATE TABLE t2(
-          id primary key,
+          id int primary key,
           "desc" text,
           "asc" text,
           key int,
-          "14_vac" boolean,
+          "14_vac" int,
           fuzzy_dog_12 varchar(10),
           beginn blob,
-          endd clob
+          endd blob
         );
         INSERT INTO t2 SELECT * from weird;
         SELECT * FROM t2;
@@ -694,7 +694,7 @@ test:do_catchsql_test(
 test:do_catchsql_test(
     "table-9.1",
     [[
-        CREATE TABLE t6(a primary key,b,a);
+        CREATE TABLE t6(a int primary key,b int,a int);
     ]], {
         -- <table-9.1>
         1, "duplicate column name: A"
@@ -718,7 +718,7 @@ test:do_catchsql_test(
     [[
         -- there is no t4 table
         --CREATE TABLE t6(a REFERENCES t4(a) NOT NULL primary key);
-        CREATE TABLE t6(a REFERENCES t2(id) NOT NULL primary key);
+        CREATE TABLE t6(a INT REFERENCES t2(id) NOT NULL primary key);
         INSERT INTO t6 VALUES(NULL);
     ]], {
         -- <table-10.1>
@@ -764,7 +764,7 @@ test:do_catchsql_test(
     "table-10.5",
     [[
         DROP TABLE t6;
-        CREATE TABLE t6(a NOT NULL NOT DEFERRABLE INITIALLY IMMEDIATE primary key);
+        CREATE TABLE t6(a int NOT NULL NOT DEFERRABLE INITIALLY IMMEDIATE primary key);
     ]], {
         -- <table-10.5>
         0
@@ -775,7 +775,7 @@ test:do_catchsql_test(
     "table-10.6",
     [[
         DROP TABLE t6;
-        CREATE TABLE t6(a NOT NULL DEFERRABLE INITIALLY DEFERRED primary key);
+        CREATE TABLE t6(a int NOT NULL DEFERRABLE INITIALLY DEFERRED primary key);
     ]], {
         -- <table-10.6>
         0
@@ -786,7 +786,7 @@ test:do_catchsql_test(
     "table-10.7",
     [[
         DROP TABLE t6;
-        CREATE TABLE t6(a primary key,
+        CREATE TABLE t6(a int primary key,
           FOREIGN KEY (a) REFERENCES t4(b) DEFERRABLE INITIALLY DEFERRED
         );
     ]], {
@@ -800,8 +800,8 @@ test:do_catchsql_test(
     [[
         DROP TABLE IF EXISTS t6;
         DROP TABLE IF EXISTS t4;
-        CREATE TABLE t4(x UNIQUE, y, PRIMARY KEY (x, y));
-        CREATE TABLE t6(a primary key,b,c,
+        CREATE TABLE t4(x INT UNIQUE, y INT, PRIMARY KEY (x, y));
+        CREATE TABLE t6(a INT primary key,b INT,c INT,
           FOREIGN KEY (b,c) REFERENCES t4(x,y) MATCH PARTIAL
             ON UPDATE SET NULL ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED
         );
@@ -815,7 +815,7 @@ test:do_catchsql_test(
     "table-10.9",
     [[
         DROP TABLE t6;
-        CREATE TABLE t6(a primary key,b,c,
+        CREATE TABLE t6(a int primary key,b int,c int,
           FOREIGN KEY (b,c) REFERENCES t4(x)
         );
     ]], {
@@ -829,7 +829,7 @@ test:do_test(
     function()
         test:catchsql "DROP TABLE t6"
         return test:catchsql [[
-            CREATE TABLE t6(a primary key,b,c,
+            CREATE TABLE t6(a int primary key,b int,c int,
               FOREIGN KEY (b,c) REFERENCES t4(x,y,z)
             );
         ]]
@@ -844,7 +844,7 @@ test:do_test(
     function()
         test:catchsql "DROP TABLE t6"
         return test:catchsql [[
-            CREATE TABLE t6(a,b, c REFERENCES t4(x,y));
+            CREATE TABLE t6(a int,b int, c int REFERENCES t4(x,y));
         ]]
     end, {
         -- <table-10.11>
@@ -857,7 +857,7 @@ test:do_test(
     function()
         test:catchsql "DROP TABLE t6"
         return test:catchsql [[
-            CREATE TABLE t6(a,b,c,
+            CREATE TABLE t6(a int,b int,c int,
               FOREIGN KEY (b,x) REFERENCES t4(x,y)
             );
         ]]
@@ -872,7 +872,7 @@ test:do_test(
     function()
         test:catchsql "DROP TABLE t6"
         return test:catchsql [[
-            CREATE TABLE t6(a,b,c,
+            CREATE TABLE t6(a int,b int,c int,
               FOREIGN KEY (x,b) REFERENCES t4(x,y)
             );
         ]]
@@ -892,13 +892,13 @@ test:do_execsql_test(
     [[
         CREATE TABLE t7(
            a integer primary key,
-           b number(5,10),
-           c character varying (8),
+           b numeric(5,10),
+           c char(8),
            d VARCHAR(9),
-           e clob,
+           e blob,
            f BLOB,
            g Text,
-           h
+           h text
         );
         INSERT INTO t7(a) VALUES(1);
         SELECT typeof(a), typeof(b), typeof(c), typeof(d),
@@ -1042,7 +1042,7 @@ test:do_test(
     function()
         --test:execsql "BEGIN"
         for i = 0, 2000-1, 1 do
-            test:execsql("CREATE TABLE tbl"..i.." (a primary key, b, c)")
+            test:execsql("CREATE TABLE tbl"..i.." (a int primary key, b int, c int)")
         end
         --return test:execsql "COMMIT"
         return
@@ -1159,10 +1159,10 @@ test:do_test(
     function()
         local columns = {}
         for i = 0, 1000-1, 1 do
-            table.insert(columns, "c"..i)
+            table.insert(columns, "c"..i .. ' int')
         end
         columns = table.concat(columns, ",")
-        test:execsql("CREATE TABLE t(c primary key, "..columns..")")
+        test:execsql("CREATE TABLE t(c int primary key, "..columns..")")
         return
     end, {
     -- <table-15.1>
diff --git a/test/sql-tap/tkt-02a8e81d44.test.lua b/test/sql-tap/tkt-02a8e81d44.test.lua
index 746222ef9..792a5527c 100755
--- a/test/sql-tap/tkt-02a8e81d44.test.lua
+++ b/test/sql-tap/tkt-02a8e81d44.test.lua
@@ -25,7 +25,7 @@ test:plan(1)
 test:do_execsql_test(
     "tkt-02a838-1.1",
     [[
-        CREATE TABLE t1(a primary key);
+        CREATE TABLE t1(a INT primary key);
         INSERT INTO t1 VALUES(1);
         INSERT INTO t1 VALUES(2);
         INSERT INTO t1 VALUES(4);
diff --git a/test/sql-tap/tkt-31338dca7e.test.lua b/test/sql-tap/tkt-31338dca7e.test.lua
index 8b4a64870..c75e9bc76 100755
--- a/test/sql-tap/tkt-31338dca7e.test.lua
+++ b/test/sql-tap/tkt-31338dca7e.test.lua
@@ -29,8 +29,8 @@ test:do_test(
     "tkt-31338-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(x primary key);
-            CREATE TABLE t2(y primary key);
+            CREATE TABLE t1(x  INT primary key);
+            CREATE TABLE t2(y  INT primary key);
             INSERT INTO t1 VALUES(111);
             INSERT INTO t1 VALUES(222);
             INSERT INTO t2 VALUES(333);
@@ -64,9 +64,9 @@ test:do_test(
     "tkt-31338-2.1",
     function()
         return test:execsql [[
-            CREATE TABLE t3(v primary key,w);
-            CREATE TABLE t4(x primary key,y);
-            CREATE TABLE t5(z primary key);
+            CREATE TABLE t3(v  INT primary key,w INT );
+            CREATE TABLE t4(x  INT primary key,y INT );
+            CREATE TABLE t5(z  INT primary key);
             INSERT INTO t3 VALUES(111,222);
             INSERT INTO t3 VALUES(333,444);
             INSERT INTO t4 VALUES(222,333);
@@ -117,15 +117,15 @@ test:do_test(
         --    db eval "DROP TABLE $x"
         -- }
         return test:execsql [[
-            CREATE TABLE t1(a primary key,b,c,d);
-            CREATE TABLE t2(e primary key,f);
+            CREATE TABLE t1(a  INT primary key,b INT ,c INT ,d INT );
+            CREATE TABLE t2(e  INT primary key,f INT );
             INSERT INTO t1 VALUES(1,2,3,4);
             INSERT INTO t2 VALUES(10,-8);
             CREATE INDEX t1a ON t1(a);
             CREATE INDEX t1b ON t1(b);
-            CREATE TABLE t3(g primary key);
+            CREATE TABLE t3(g  INT primary key);
             INSERT INTO t3 VALUES(4);
-            CREATE TABLE t4(h primary key);
+            CREATE TABLE t4(h  INT primary key);
             INSERT INTO t4 VALUES(5);
 
             SELECT * FROM t3 LEFT JOIN t1 ON d=g LEFT JOIN t4 ON c=h
@@ -199,8 +199,8 @@ if (1 > 0)
         "tkt-31338-3.5",
         function()
             return test:execsql [[
-                CREATE TABLE t5(a primary key,b,c,d,e,f);
-                CREATE TABLE t6(g primary key,h);
+                CREATE TABLE t5(a  INT primary key,b INT ,c INT ,d INT ,e INT ,f INT );
+                CREATE TABLE t6(g  INT primary key,h INT );
                 CREATE TRIGGER t6r AFTER INSERT ON t6 BEGIN
                   INSERT INTO t5    
                     SELECT * FROM t3 LEFT JOIN t1 ON d=g LEFT JOIN t4 ON c=h
diff --git a/test/sql-tap/tkt-385a5b56b9.test.lua b/test/sql-tap/tkt-385a5b56b9.test.lua
index 4f5ea91ca..6e863c73f 100755
--- a/test/sql-tap/tkt-385a5b56b9.test.lua
+++ b/test/sql-tap/tkt-385a5b56b9.test.lua
@@ -21,7 +21,7 @@ testprefix = "tkt-385a5b56b9"
 test:do_execsql_test(
     1.0,
     [[
-        CREATE TABLE t1(id primary key, x, y);
+        CREATE TABLE t1(id INT primary key, x INT, y INT);
         INSERT INTO t1 VALUES(1, 1, NULL);
         INSERT INTO t1 VALUES(2, 2, NULL);
         INSERT INTO t1 VALUES(3, 1, NULL);
@@ -57,7 +57,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     2.0,
     [[
-        CREATE TABLE t2(x primary key, y NOT NULL);
+        CREATE TABLE t2(x INT primary key, y INT NOT NULL);
         CREATE UNIQUE INDEX t2x ON t2(x);
         CREATE UNIQUE INDEX t2y ON t2(y);
     ]])
diff --git a/test/sql-tap/tkt-38cb5df375.test.lua b/test/sql-tap/tkt-38cb5df375.test.lua
index dc8702ae3..726496aa3 100755
--- a/test/sql-tap/tkt-38cb5df375.test.lua
+++ b/test/sql-tap/tkt-38cb5df375.test.lua
@@ -35,7 +35,7 @@ local ii
 test:do_execsql_test(
     "tkt-38cb5df375.0",
     [[
-        CREATE TABLE t1(a primary key);
+        CREATE TABLE t1(a  INT primary key);
         INSERT INTO t1 VALUES(1);
         INSERT INTO t1 VALUES(2);
         INSERT INTO t1 SELECT a+2 FROM t1;
diff --git a/test/sql-tap/tkt-3998683a16.test.lua b/test/sql-tap/tkt-3998683a16.test.lua
index d0b322d19..257965cb7 100755
--- a/test/sql-tap/tkt-3998683a16.test.lua
+++ b/test/sql-tap/tkt-3998683a16.test.lua
@@ -25,7 +25,7 @@ test:do_test(
     "tkt-3998683a16.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(x primary key, y REAL);
+            CREATE TABLE t1(x  INT primary key, y REAL);
             INSERT INTO t1 VALUES(1, '1.0');
             INSERT INTO t1 VALUES(2, '.125');
             INSERT INTO t1 VALUES(3, '123.');
diff --git a/test/sql-tap/tkt-4a03edc4c8.test.lua b/test/sql-tap/tkt-4a03edc4c8.test.lua
index ea42d78c9..00bf311b4 100755
--- a/test/sql-tap/tkt-4a03edc4c8.test.lua
+++ b/test/sql-tap/tkt-4a03edc4c8.test.lua
@@ -26,7 +26,7 @@ test:do_test(
         test:execsql [[
             CREATE TABLE t1(
               a INTEGER PRIMARY KEY,
-              b UNIQUE
+              b INTEGER UNIQUE
             );
             INSERT INTO t1 VALUES(1, 1);
             INSERT INTO t1 VALUES(2, 2);
diff --git a/test/sql-tap/tkt-4c86b126f2.test.lua b/test/sql-tap/tkt-4c86b126f2.test.lua
index 529bcc9c4..ad0fab7ca 100755
--- a/test/sql-tap/tkt-4c86b126f2.test.lua
+++ b/test/sql-tap/tkt-4c86b126f2.test.lua
@@ -51,7 +51,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt-4c86b126f2-2.1",
     [[
-        CREATE TABLE t1(x TEXT PRIMARY KEY, y TEXT UNIQUE, z);
+        CREATE TABLE t1(x TEXT PRIMARY KEY, y TEXT UNIQUE, z TEXT);
         INSERT INTO t1 VALUES('ghi','jkl','y');
         SELECT * FROM t1 WHERE (x='ghi' OR y='jkl') AND z IS NOT NULL;
     ]], {
diff --git a/test/sql-tap/tkt-4dd95f6943.test.lua b/test/sql-tap/tkt-4dd95f6943.test.lua
index 016551c5b..88047d104 100755
--- a/test/sql-tap/tkt-4dd95f6943.test.lua
+++ b/test/sql-tap/tkt-4dd95f6943.test.lua
@@ -21,7 +21,7 @@ testprefix = "tkt-4dd95f6943"
 test:do_execsql_test(
     1.0,
     [[
-        CREATE TABLE t1(id primary key, x);
+        CREATE TABLE t1(id INT primary key, x INT);
         INSERT INTO t1 VALUES (1, 3), (2, 4), (3, 2), (4, 1), (5, 5), (6, 6);
     ]])
 
@@ -62,7 +62,7 @@ end
 test:do_execsql_test(
     2.0,
     [[
-        CREATE TABLE t2(id primary key, x, y);
+        CREATE TABLE t2(id INT primary key, x INT, y INT);
         INSERT INTO t2 VALUES (1, 5, 3), (2, 5, 4), (3, 5, 2), (4, 5, 1), (5, 5, 5), (6, 5, 6);
         INSERT INTO t2 VALUES (7, 1, 3), (8, 1, 4), (9, 1, 2), (10, 1, 1), (11, 1, 5), (12, 1, 6);
         INSERT INTO t2 VALUES (13, 3, 3), (14, 3, 4), (15, 3, 2), (16, 3, 1), (17, 3, 5), (18, 3, 6);
@@ -70,7 +70,7 @@ test:do_execsql_test(
         INSERT INTO t2 VALUES (25, 4, 3), (26, 4, 4), (27, 4, 2), (28, 4, 1), (29, 4, 5), (30, 4, 6);
         INSERT INTO t2 VALUES (31, 6, 3), (32, 6, 4), (33, 6, 2), (34, 6, 1), (35, 6, 5), (36, 6, 6);
 
-        CREATE TABLE t3(a primary key, b);
+        CREATE TABLE t3(a INT primary key, b INT);
         INSERT INTO t3 VALUES (2, 2), (4, 4), (5, 5);
         CREATE UNIQUE INDEX t3i1 ON t3(a ASC);
         CREATE UNIQUE INDEX t3i2 ON t3(b DESC);
@@ -214,11 +214,11 @@ end
 test:do_execsql_test(
     3.0,
     [[
-        CREATE TABLE t7(x primary key);
+        CREATE TABLE t7(x INT primary key);
         INSERT INTO t7 VALUES (1), (2), (3);
         CREATE INDEX i7 ON t7(x);
 
-        CREATE TABLE t8(y primary key);
+        CREATE TABLE t8(y INT primary key);
         INSERT INTO t8 VALUES (1), (2), (3);
     ]])
 
diff --git a/test/sql-tap/tkt-4ef7e3cfca.test.lua b/test/sql-tap/tkt-4ef7e3cfca.test.lua
index b86e177e3..29484ddbd 100755
--- a/test/sql-tap/tkt-4ef7e3cfca.test.lua
+++ b/test/sql-tap/tkt-4ef7e3cfca.test.lua
@@ -24,7 +24,7 @@ testprefix = "tkt-4ef7e3cfca"
 test:do_catchsql_test(
     1.1,
     [[
-        CREATE TABLE x(a primary key);
+        CREATE TABLE x(a  INT primary key);
         CREATE TRIGGER t AFTER INSERT ON x BEGIN
           SELECT * FROM x WHERE abc.a = 1;
         END;
@@ -40,10 +40,10 @@ test:execsql("DROP TABLE x;");
 test:do_execsql_test(
     2.1,
     [[
-        CREATE TABLE w(a primary key);
-        CREATE TABLE x(a primary key);
-        CREATE TABLE y(a primary key);
-        CREATE TABLE z(a primary key);
+        CREATE TABLE w(a  INT primary key);
+        CREATE TABLE x(a  INT primary key);
+        CREATE TABLE y(a  INT primary key);
+        CREATE TABLE z(a  INT primary key);
 
         INSERT INTO x(a) VALUES(5);
         INSERT INTO y(a) VALUES(10);
@@ -52,7 +52,7 @@ test:do_execsql_test(
           INSERT INTO z
           SELECT (SELECT x.a + y.a FROM y) FROM x;
         END;
-        INSERT INTO w VALUES('incorrect');
+        INSERT INTO w VALUES(1);
     ]])
 
 test:do_execsql_test(
@@ -75,10 +75,10 @@ test:execsql([[
 test:do_execsql_test(
     3.1,
     [[
-        CREATE TABLE w(a primary key);
-        CREATE TABLE x(b primary key);
-        CREATE TABLE y(a primary key);
-        CREATE TABLE z(a primary key);
+        CREATE TABLE w(a  INT primary key);
+        CREATE TABLE x(b  INT primary key);
+        CREATE TABLE y(a  INT primary key);
+        CREATE TABLE z(a  INT primary key);
 
         INSERT INTO x(b) VALUES(5);
         INSERT INTO y(a) VALUES(10);
@@ -87,7 +87,7 @@ test:do_execsql_test(
           INSERT INTO z
           SELECT (SELECT x.b + y.a FROM y) FROM x;
         END;
-        INSERT INTO w VALUES('assert');
+        INSERT INTO w VALUES(2);
     ]])
 
 test:do_execsql_test(
diff --git a/test/sql-tap/tkt-54844eea3f.test.lua b/test/sql-tap/tkt-54844eea3f.test.lua
index be088eaa7..2cb1986cc 100755
--- a/test/sql-tap/tkt-54844eea3f.test.lua
+++ b/test/sql-tap/tkt-54844eea3f.test.lua
@@ -61,7 +61,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "1.2",
     [[
-        CREATE TABLE t4(id primary key, a, b, c);
+        CREATE TABLE t4(id INT primary key, a TEXT, b TEXT, c TEXT);
         INSERT INTO t4 VALUES(1, 'a', 1, 'one');
         INSERT INTO t4 VALUES(2, 'a', 2, 'two');
         INSERT INTO t4 VALUES(3, 'b', 1, 'three');
diff --git a/test/sql-tap/tkt-7bbfb7d442.test.lua b/test/sql-tap/tkt-7bbfb7d442.test.lua
index 2750b36d9..3d8d423ed 100755
--- a/test/sql-tap/tkt-7bbfb7d442.test.lua
+++ b/test/sql-tap/tkt-7bbfb7d442.test.lua
@@ -27,17 +27,17 @@ if (1 > 0)
     test:do_execsql_test(
         1.1,
         [[
-            CREATE TABLE t1(id primary key, a, b);
+            CREATE TABLE t1(id  INT primary key, a INT , b TEXT);
             INSERT INTO t1 VALUES(1, 1, 'one');
             INSERT INTO t1 VALUES(2, 2, 'two');
             INSERT INTO t1 VALUES(3, 3, 'three');
 
-            CREATE TABLE t2(id primary key, c, d);
+            CREATE TABLE t2(id  INT primary key, c TEXT, d TEXT);
             INSERT INTO t2 VALUES(1, 'one', 'I');
             INSERT INTO t2 VALUES(2, 'two', 'II');
             INSERT INTO t2 VALUES(3, 'three', 'III');
 
-            CREATE TABLE t3(t3_a PRIMARY KEY, t3_d);
+            CREATE TABLE t3(t3_a  INT PRIMARY KEY, t3_d TEXT);
             CREATE TRIGGER t3t AFTER INSERT ON t3 WHEN new.t3_d IS NULL BEGIN
               UPDATE t3 SET t3_d = (
                 SELECT d FROM 
@@ -93,7 +93,7 @@ if (1 > 0)
               Variant INTEGER NOT NULL DEFAULT 0,
               ControlDate DATE NOT NULL,
               ControlState INTEGER NOT NULL DEFAULT -1,
-              DeliveredQty VARCHAR(30)
+              DeliveredQty TEXT
             );
 
             CREATE TRIGGER TGR_InventoryControl_AfterInsert
@@ -161,7 +161,7 @@ if (1 > 0)
 
 
             INSERT INTO InventoryControl(SKU, Variant, ControlDate) SELECT 
-                II.SKU AS SKU, II.Variant AS Variant, '2011-08-30' AS ControlDate 
+                II.SKU AS SKU, II.Variant AS Variant, julianday('2011-08-30') AS ControlDate 
                 FROM InventoryItem II;
         ]])
 
diff --git a/test/sql-tap/tkt-80ba201079.test.lua b/test/sql-tap/tkt-80ba201079.test.lua
index 368eae5a7..9d204ac66 100755
--- a/test/sql-tap/tkt-80ba201079.test.lua
+++ b/test/sql-tap/tkt-80ba201079.test.lua
@@ -27,11 +27,11 @@ test:do_test(
     "tkt-80ba2-100",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a primary key);
+            CREATE TABLE t1(a TEXT primary key);
             INSERT INTO t1 VALUES('A');
-            CREATE TABLE t2(b primary key);
+            CREATE TABLE t2(b TEXT primary key);
             INSERT INTO t2 VALUES('B');
-            CREATE TABLE t3(c primary key);
+            CREATE TABLE t3(c TEXT primary key);
             INSERT INTO t3 VALUES('C');
             SELECT * FROM t1, t2
              WHERE (a='A' AND b='X')
@@ -176,10 +176,10 @@ test:execsql([[
 test:do_execsql_test(
     301,
     [[
-        CREATE TABLE t1(a primary key, b, c);
+        CREATE TABLE t1(a TEXT primary key, b TEXT , c TEXT);
         CREATE INDEX i1 ON t1(a);
         CREATE INDEX i2 ON t1(b);
-        CREATE TABLE t2(d primary key, e);
+        CREATE TABLE t2(d TEXT primary key, e TEXT);
 
         INSERT INTO t1 VALUES('A', 'B', 'C');
         INSERT INTO t2 VALUES('D', 'E');
diff --git a/test/sql-tap/tkt-80e031a00f.test.lua b/test/sql-tap/tkt-80e031a00f.test.lua
index 5b5481d83..0d16268a8 100755
--- a/test/sql-tap/tkt-80e031a00f.test.lua
+++ b/test/sql-tap/tkt-80e031a00f.test.lua
@@ -120,7 +120,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt-80e031a00f.5",
     [[
-        CREATE TABLE t1(x PRIMARY key);
+        CREATE TABLE t1(x  INT PRIMARY key);
         SELECT 1 IN t1;
     ]], {
         -- <tkt-80e031a00f.5>
@@ -453,29 +453,29 @@ test:do_test(
     "tkt-80e031a00f.104",
     function()
         test:execsql [[
-            CREATE TABLE t4(a PRIMARY KEY);
+            CREATE TABLE t4(a  INT PRIMARY KEY);
             CREATE TABLE t5(b INTEGER PRIMARY KEY);
-            CREATE TABLE t6(c PRIMARY KEY);
+            CREATE TABLE t6(c  INT PRIMARY KEY);
             INSERT INTO t4 VALUES(2);
             INSERT INTO t4 VALUES(3);
             INSERT INTO t4 VALUES(4);
             INSERT INTO t5 SELECT * FROM t4;
             INSERT INTO t6 SELECT * FROM t4;
-            CREATE TABLE t4n(a, b PRIMARY KEY);
+            CREATE TABLE t4n(a INT , b  INT PRIMARY KEY);
             INSERT INTO t4n VALUES(2, 1),
                             (3, 2),
                             (4, 3),
                             (null, 4);
-            CREATE TABLE t6n(c, b PRIMARY KEY);
+            CREATE TABLE t6n(c INT , b  INT PRIMARY KEY);
             INSERT INTO t6n select * from t4n;
-            CREATE TABLE t7(a PRIMARY KEY);
-            CREATE TABLE t8(c PRIMARY KEY);
+            CREATE TABLE t7(a TEXT PRIMARY KEY);
+            CREATE TABLE t8(c TEXT PRIMARY KEY);
             INSERT INTO t7 VALUES('b');
             INSERT INTO t7 VALUES('c');
             INSERT INTO t7 VALUES('d');
             INSERT INTO t8 SELECT * FROM t7;
-            CREATE TABLE t7n(a, b PRIMARY KEY);
-            CREATE TABLE t8n(c, b PRIMARY KEY);
+            CREATE TABLE t7n(a TEXT, b  INT PRIMARY KEY);
+            CREATE TABLE t8n(c TEXT, b  INT PRIMARY KEY);
             INSERT INTO t7n VALUES('b', 1),
                                   ('c', 2),
                                   ('d', 3),
diff --git a/test/sql-tap/tkt-8c63ff0ec.test.lua b/test/sql-tap/tkt-8c63ff0ec.test.lua
index a52356a07..8e49db57d 100755
--- a/test/sql-tap/tkt-8c63ff0ec.test.lua
+++ b/test/sql-tap/tkt-8c63ff0ec.test.lua
@@ -24,11 +24,11 @@ testprefix = "tkt-8c63ff0ec"
 test:do_execsql_test(
     1.1,
     [[
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, d, e);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT, c INT, d INT, e INT);
         INSERT INTO t1 VALUES(1,20,30,40,50),(3,60,70,80,90);
         CREATE TABLE t2(x INTEGER PRIMARY KEY);
         INSERT INTO t2 VALUES(2);
-        CREATE TABLE t3(id primary key, z);
+        CREATE TABLE t3(id INT primary key, z INT);
         INSERT INTO t3 VALUES(1, 2),(2, 2),(3, 2),(4, 2);
 
         SELECT a, b+c FROM t1
diff --git a/test/sql-tap/tkt-9a8b09f8e6.test.lua b/test/sql-tap/tkt-9a8b09f8e6.test.lua
index 043194277..b316fe701 100755
--- a/test/sql-tap/tkt-9a8b09f8e6.test.lua
+++ b/test/sql-tap/tkt-9a8b09f8e6.test.lua
@@ -72,10 +72,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     1.5,
     [[
-        CREATE TABLE t5(id primary key, x, y);
-        INSERT INTO t5 VALUES(1, '1', 'one');
+        CREATE TABLE t5(id  INT primary key, x INT , y TEXT);
+        INSERT INTO t5 VALUES(1, 1, 'one');
         INSERT INTO t5 VALUES(2, 1, 'two');
-        INSERT INTO t5 VALUES(3, '1.0', 'three');
+        INSERT INTO t5 VALUES(3, 1.0, 'three');
         INSERT INTO t5 VALUES(4, 1.0, 'four');
     ]], {
         -- <1.5>
@@ -139,7 +139,7 @@ test:do_execsql_test(
         SELECT x FROM t1 WHERE 1.0 IN (x);
     ]], {
         -- <2.6>
-        
+        "1"
         -- </2.6>
     })
 
@@ -239,7 +239,7 @@ test:do_execsql_test(
         SELECT x FROM t2 WHERE '1.0' IN (x);
     ]], {
         -- <3.8>
-        1
+        
         -- </3.8>
     })
 
@@ -309,7 +309,7 @@ test:do_execsql_test(
         SELECT x FROM t3 WHERE '1' IN (x);
     ]], {
         -- <4.7>
-        1
+        
         -- </4.7>
     })
 
@@ -449,7 +449,7 @@ test:do_execsql_test(
         SELECT x, y FROM t5 WHERE x IN (1);
     ]], {
         -- <6.1>
-        1, "two", 1.0, "four"
+        1, "one", 1, "two", 1, "three", 1.0, "four"
         -- </6.1>
     })
 
@@ -459,7 +459,7 @@ test:do_execsql_test(
         SELECT x, y FROM t5 WHERE x IN (1.0);
     ]], {
         -- <6.2>
-        1, "two", 1.0, "four"
+        1, "one", 1, "two", 1, "three", 1.0, "four"
         -- </6.2>
     })
 
@@ -469,7 +469,7 @@ test:do_execsql_test(
         SELECT x, y FROM t5 WHERE x IN ('1');
     ]], {
         -- <6.3>
-        "1", "one"
+        1, "one", 1, "two", 1, "three", 1.0, "four"
         -- </6.3>
     })
 
@@ -479,7 +479,7 @@ test:do_execsql_test(
         SELECT x, y FROM t5 WHERE x IN ('1.0');
     ]], {
         -- <6.4>
-        "1.0", "three"
+        1, "one", 1, "two", 1, "three", 1.0, "four"
         -- </6.4>
     })
 
@@ -489,7 +489,7 @@ test:do_execsql_test(
         SELECT x, y FROM t5 WHERE 1 IN (x);
     ]], {
         -- <6.5>
-        1, "two", 1.0, "four"
+        1, "one", 1, "two", 1, "three", 1.0, "four"
         -- </6.5>
     })
 
@@ -499,7 +499,7 @@ test:do_execsql_test(
         SELECT x, y FROM t5 WHERE 1.0 IN (x);
     ]], {
         -- <6.6>
-        1, "two", 1.0, "four"
+        1, "one", 1, "two", 1, "three", 1.0, "four"
         -- </6.6>
     })
 
@@ -509,7 +509,7 @@ test:do_execsql_test(
         SELECT x, y FROM t5 WHERE '1' IN (x);
     ]], {
         -- <6.7>
-        "1", "one"
+        1, "one", 1, "two", 1, "three", 1.0, "four"
         -- </6.7>
     })
 
@@ -519,7 +519,6 @@ test:do_execsql_test(
         SELECT x, y FROM t5 WHERE '1.0' IN (x);
     ]], {
         -- <6.8>
-        "1.0", "three"
         -- </6.8>
     })
 
diff --git a/test/sql-tap/tkt-a7b7803e.test.lua b/test/sql-tap/tkt-a7b7803e.test.lua
index 37c2c006a..1827f40bc 100755
--- a/test/sql-tap/tkt-a7b7803e.test.lua
+++ b/test/sql-tap/tkt-a7b7803e.test.lua
@@ -25,7 +25,7 @@ test:do_test(
     "tkt-a7b7803e.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a primary key,b);
+            CREATE TABLE t1(a INT primary key,b TEXT);
             INSERT INTO t1 VALUES(0,'first'),(99,'fuzzy');
             SELECT (t1.a==0) AS x, b
               FROM t1
diff --git a/test/sql-tap/tkt-a8a0d2996a.test.lua b/test/sql-tap/tkt-a8a0d2996a.test.lua
index 3b796ebd8..6f5860f82 100755
--- a/test/sql-tap/tkt-a8a0d2996a.test.lua
+++ b/test/sql-tap/tkt-a8a0d2996a.test.lua
@@ -23,7 +23,7 @@ testprefix = "tkt-a8a0d2996a"
 test:do_execsql_test(
     1.0,
     [[
-        CREATE TABLE t(x primary key,y);
+        CREATE TABLE t(x TEXT primary key,y TEXT);
         INSERT INTO t VALUES('1','1');
         SELECT typeof(x), typeof(y) FROM t WHERE 1=x+0 AND y=='1';
     ]], {
@@ -244,4 +244,4 @@ test:do_execsql_test(
         -- </4.6>
     })
 
-test:finish_test()
\ No newline at end of file
+test:finish_test()
diff --git a/test/sql-tap/tkt-b1d3a2e531.test.lua b/test/sql-tap/tkt-b1d3a2e531.test.lua
index 324ffa0c8..27fe595e9 100755
--- a/test/sql-tap/tkt-b1d3a2e531.test.lua
+++ b/test/sql-tap/tkt-b1d3a2e531.test.lua
@@ -27,8 +27,8 @@ testprefix = "tkt-b1d3a2e531"
 test:do_execsql_test(
     1.1,
     [[
-        CREATE TABLE pp(x PRIMARY KEY);
-        CREATE TABLE cc(y primary key REFERENCES pp DEFERRABLE INITIALLY DEFERRED);
+        CREATE TABLE pp(x TEXT PRIMARY KEY);
+        CREATE TABLE cc(y TEXT primary key REFERENCES pp DEFERRABLE INITIALLY DEFERRED);
         INSERT INTO pp VALUES('abc');
         INSERT INTO cc VALUES('abc');
     ]])
@@ -43,8 +43,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     1.3,
     [[
-        CREATE TABLE pp(x PRIMARY KEY);
-        CREATE TABLE cc(y primary key REFERENCES pp DEFERRABLE INITIALLY DEFERRED);
+        CREATE TABLE pp(x TEXT PRIMARY KEY);
+        CREATE TABLE cc(y TEXT primary key REFERENCES pp DEFERRABLE INITIALLY DEFERRED);
         INSERT INTO pp VALUES('abc');
         INSERT INTO cc VALUES('abc');
     ]])
@@ -95,11 +95,11 @@ test:do_execsql_test(
 test:do_execsql_test(
     3.1,
     [[
-        CREATE TABLE pp1(x PRIMARY KEY);
-        CREATE TABLE cc1(y REFERENCES pp1 DEFERRABLE INITIALLY DEFERRED, a primary key);
+        CREATE TABLE pp1(x  INT PRIMARY KEY);
+        CREATE TABLE cc1(y  INT REFERENCES pp1 DEFERRABLE INITIALLY DEFERRED, a  INT primary key);
 
-        CREATE TABLE pp2(x PRIMARY KEY);
-        CREATE TABLE cc2(y primary key REFERENCES pp1 DEFERRABLE INITIALLY DEFERRED);
+        CREATE TABLE pp2(x  INT PRIMARY KEY);
+        CREATE TABLE cc2(y  INT primary key REFERENCES pp1 DEFERRABLE INITIALLY DEFERRED);
 
         INSERT INTO pp1 VALUES(2200);
         INSERT INTO cc1 VALUES(NULL, 1);
diff --git a/test/sql-tap/tkt-b351d95f9.test.lua b/test/sql-tap/tkt-b351d95f9.test.lua
index 5f4c08e7e..780950cfd 100755
--- a/test/sql-tap/tkt-b351d95f9.test.lua
+++ b/test/sql-tap/tkt-b351d95f9.test.lua
@@ -24,10 +24,10 @@ test:plan(3)
 test:do_execsql_test(
     "tkt-b351d95.1",
     [[
-        CREATE table t1(a primary key,b);
+        CREATE table t1(a text primary key,b text);
         INSERT INTO t1 VALUES('name1','This is a test');
         INSERT INTO t1 VALUES('name2','xyz');
-        CREATE TABLE t2(x primary key,y);
+        CREATE TABLE t2(x TEXT primary key,y TEXT);
         INSERT INTO t2 SELECT a, CASE b WHEN 'xyz' THEN null ELSE b END FROM t1;
         SELECT x, y FROM t2 ORDER BY x;
     ]], {
diff --git a/test/sql-tap/tkt-b75a9ca6b0.test.lua b/test/sql-tap/tkt-b75a9ca6b0.test.lua
index 5950892b7..0f61f0de5 100755
--- a/test/sql-tap/tkt-b75a9ca6b0.test.lua
+++ b/test/sql-tap/tkt-b75a9ca6b0.test.lua
@@ -27,7 +27,7 @@ testprefix = "tkt-b75a9ca6b0"
 test:do_execsql_test(
     1,
     [[
-        CREATE TABLE t1 (id primary key, x, y);
+        CREATE TABLE t1 (id INT primary key, x INT, y INT);
         INSERT INTO t1 VALUES (1, 1, 3);
         INSERT INTO t1 VALUES (2, 2, 2);
         INSERT INTO t1 VALUES (3, 3, 1);
diff --git a/test/sql-tap/tkt-ba7cbfaedc.test.lua b/test/sql-tap/tkt-ba7cbfaedc.test.lua
index d4cf27e47..2aad10f2d 100755
--- a/test/sql-tap/tkt-ba7cbfaedc.test.lua
+++ b/test/sql-tap/tkt-ba7cbfaedc.test.lua
@@ -22,7 +22,7 @@ testprefix = "tkt-ba7cbfaedc"
 test:do_execsql_test(
     1,
     [[
-        CREATE TABLE t1 (id primary key, x, y);
+        CREATE TABLE t1 (id  INT primary key, x INT , y TEXT);
         INSERT INTO t1 VALUES (1, 3, 'a');
         INSERT INTO t1 VALUES (2, 1, 'a'); 
         INSERT INTO t1 VALUES (3, 2, 'b');
diff --git a/test/sql-tap/tkt-f973c7ac31.test.lua b/test/sql-tap/tkt-f973c7ac31.test.lua
index 8179f96e2..e846c2aad 100755
--- a/test/sql-tap/tkt-f973c7ac31.test.lua
+++ b/test/sql-tap/tkt-f973c7ac31.test.lua
@@ -20,7 +20,7 @@ test:plan(21)
 test:do_execsql_test(
     "tkt-f973c7ac3-1.0",
     [[
-        CREATE TABLE t(id primary key, c1 INTEGER, c2 INTEGER);
+        CREATE TABLE t(id INT primary key, c1 INTEGER, c2 INTEGER);
         INSERT INTO t VALUES(1, 5, 5);
         INSERT INTO t VALUES(2, 5, 4);
     ]], {
diff --git a/test/sql-tap/tkt-fa7bf5ec.test.lua b/test/sql-tap/tkt-fa7bf5ec.test.lua
index cafc7ce98..91d876c5a 100755
--- a/test/sql-tap/tkt-fa7bf5ec.test.lua
+++ b/test/sql-tap/tkt-fa7bf5ec.test.lua
@@ -30,7 +30,7 @@ test:plan(1)
 test:do_execsql_test(
     "tkt-fa7bf5ec-1",
     [[
-        CREATE TABLE t1(id primary key, x);
+        CREATE TABLE t1(id INT primary key, x TEXT);
         INSERT INTO t1 VALUES (1, 'a');
         INSERT INTO t1 VALUES (2, 'A');
         INSERT INTO t1 VALUES (3, 'A');
diff --git a/test/sql-tap/tkt1443.test.lua b/test/sql-tap/tkt1443.test.lua
index 44b96fc2c..050e74acf 100755
--- a/test/sql-tap/tkt1443.test.lua
+++ b/test/sql-tap/tkt1443.test.lua
@@ -54,7 +54,7 @@ test:do_test(
         return test:execsql(string.format([[
             CREATE TABLE Items(
                 itemId integer primary key,
-                 item str unique
+                 item  TEXT unique
             );
             INSERT INTO Items VALUES(0, 'ALL');
             INSERT INTO Items VALUES(1, 'double:source');
@@ -64,13 +64,13 @@ test:do_test(
 
             CREATE TABLE Labels(
                 labelId INTEGER PRIMARY KEY,
-                label STR UNIQUE
+                label  TEXT UNIQUE
             );
             INSERT INTO Labels VALUES(0, 'ALL');
             INSERT INTO Labels VALUES(1, 'localhost at rpl:linux');
             INSERT INTO Labels VALUES(2, 'localhost at rpl:branch');
 
-            CREATE TABLE LabelMap(id primary key,
+            CREATE TABLE LabelMap(id  INT primary key,
                 itemId INTEGER,
                 labelId INTEGER,
                 branchId integer
@@ -84,9 +84,9 @@ test:do_test(
 
             CREATE TABLE Users (
                 userId INTEGER PRIMARY KEY,
-                "user" STRING UNIQUE,
-                salt BINARY,
-                password STRING
+                "user" TEXT UNIQUE,
+                salt  BLOB,
+                password  TEXT
             );
             INSERT INTO Users VALUES(1, 'test', 'Šæ%s',
                        '43ba0f45014306bd6df529551ffdb3df');
@@ -94,7 +94,7 @@ test:do_test(
                        'cf07c8348fdf675cc1f7696b7d45191b');
             CREATE TABLE UserGroups (
                 userGroupId INTEGER PRIMARY KEY,
-                userGroup STRING UNIQUE
+                userGroup  TEXT UNIQUE
             );
             INSERT INTO UserGroups VALUES(1, 'test');
             INSERT INTO UserGroups VALUES(2, 'limited');
diff --git a/test/sql-tap/tkt1444.test.lua b/test/sql-tap/tkt1444.test.lua
index 945eab157..286e4a3e5 100755
--- a/test/sql-tap/tkt1444.test.lua
+++ b/test/sql-tap/tkt1444.test.lua
@@ -28,7 +28,7 @@ test:plan(4)
 test:do_execsql_test(
     "tkt1444-1.1",
     [[
-        CREATE TABLE DemoTable (id primary key, x INTEGER, TextKey TEXT, DKey Real);
+        CREATE TABLE DemoTable (id  INT primary key, x INTEGER, TextKey TEXT, DKey NUM);
         CREATE INDEX DemoTableIdx ON DemoTable (TextKey);
         INSERT INTO DemoTable VALUES(1, 9,8,7);
         INSERT INTO DemoTable VALUES(2, 1,2,3);
diff --git a/test/sql-tap/tkt1449.test.lua b/test/sql-tap/tkt1449.test.lua
index 3bb931cf6..746c917b5 100755
--- a/test/sql-tap/tkt1449.test.lua
+++ b/test/sql-tap/tkt1449.test.lua
@@ -34,45 +34,45 @@ test:do_execsql_test(
     [[
         -- Tarantool: DDL is prohibited inside a transaction so far
         -- START TRANSACTION;
-        CREATE TABLE ACLS(ISSUEID text(50) not null, OBJECTID text(50) not null, PARTICIPANTID text(50) not null, PERMISSIONBITS int not null, constraint PK_ACLS primary key (ISSUEID, OBJECTID, PARTICIPANTID));
-        CREATE TABLE ACTIONITEMSTATUSES(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, FRIENDLYNAME text(100) not null, REVISION int not null, SHORTNAME text(30) not null, LONGNAME text(200) not null, ATTACHMENTHANDLING int not null, RESULT int not null, NOTIFYCREATOR text(1) null, NOTIFYASSIGNEE text(1) null, NOTIFYFYI text(1) null, NOTIFYCLOSURETEAM text(1) null, NOTIFYCOORDINATORS text(1) null, COMMENTREQUIRED text(1) not null, constraint PK_ACTIONITEMSTATUSES primary key (ISSUEID, OBJECTID));
-        CREATE TABLE ACTIONITEMTYPES(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, REVISION int not null, LABEL text(200) not null, INSTRUCTIONS text not null, EMAILINSTRUCTIONS text null, ALLOWEDSTATUSES text not null, INITIALSTATUS text(100) not null, COMMENTREQUIRED text(1) not null, ATTACHMENTHANDLING int not null, constraint PK_ACTIONITEMTYPES primary key (ISSUEID, OBJECTID));
-        CREATE TABLE ATTACHMENTS(TQUNID text(36) not null, OBJECTID text(50) null, ISSUEID text(50) null, DATASTREAM blob not null, CONTENTENCODING text(50) null, CONTENTCHARSET text(50) null, CONTENTTYPE text(100) null, CONTENTID text(100) null, CONTENTLOCATION text(100) null, CONTENTNAME text(100) not null, constraint PK_ATTACHMENTS primary key (TQUNID));
-        CREATE TABLE COMPLIANCEPOLICIES(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, BODY text null, constraint PK_COMPLIANCEPOLICIES primary key (ISSUEID, OBJECTID));
-        CREATE TABLE DBHISTORY(id primary key, DATETIME text(25) not null, OPERATION text(20) not null, KUBIVERSION text(100) not null, FROMVERSION int null, TOVERSION int null);
-        CREATE TABLE DBINFO(id primary key, FINGERPRINT text(32) not null, VERSION int not null);
-        CREATE TABLE DETACHEDATTACHMENTS (TQUNID text(36) not null, ISSUEID text(50) not null, OBJECTID text(50) not null, PATH text(300) not null, DETACHEDFILELASTMODTIMESTAMP text(25) null, CONTENTID text(100) not null, constraint PK_DETACHEDATTACHMENTS primary key (TQUNID));
-        CREATE TABLE DOCREFERENCES(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, REFERENCEDOCUMENTID text(50) null, constraint PK_DOCREFERENCES primary key (ISSUEID, OBJECTID));
-        CREATE TABLE DQ (TQUNID text(36) not null, ISSUEID text(50) not null, DEPENDSID text(50) null, DEPENDSTYPE int null, DEPENDSCOMMANDSTREAM blob null, DEPENDSNODEIDSEQNOKEY text(100) null, DEPENDSACLVERSION int null, constraint PK_DQ primary key (TQUNID));
-        CREATE TABLE EMAILQ(id primary key, TIMEQUEUED int not null, NODEID text(50) not null, MIME blob not null, TQUNID text(36) not null);
-        CREATE TABLE ENTERPRISEDATA(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, DATE1 text(25) null, DATE2 text(25) null, DATE3 text(25) null, DATE4 text(25) null, DATE5 text(25) null, DATE6 text(25) null, DATE7 text(25) null, DATE8 text(25) null, DATE9 text(25) null, DATE10 text(25) null, VALUE1 int null, VALUE2 int null, VALUE3 int null, VALUE4 int null, VALUE5 int null, VALUE6 int null, VALUE7 int null, VALUE8 int null, VALUE9 int null, VALUE10 int null, VALUE11 int null, VALUE12 int null, VALUE13 int null, VALUE14 int null, VALUE15 int null, VALUE16 int null, VALUE17 int null, VALUE18 int null, VALUE19 int null, VALUE20 int null, STRING1 text(300) null, STRING2 text(300) null, STRING3 text(300) null, STRING4 text(300) null, STRING5 text(300) null, STRING6 text(300) null, STRING7 text(300) null, STRING8 text(300) null, STRING9 text(300) null, STRING10 text(300) null, LONGSTRING1 text null, LONGSTRING2 text null, LONGSTRING3 text null, LONGSTRING4 text null, LONGSTRING5 text null, LONGSTRING6 text null, LONGSTRING7 text null, LONGSTRING8 text null, LONGSTRING9 text null, LONGSTRING10 text null, constraint PK_ENTERPRISEDATA primary key (ISSUEID, OBJECTID));
-        CREATE TABLE FILEMORGUE(TQUNID text(36) not null, PATH text(300) not null, DELETEFOLDERWHENEMPTY text(1) null, constraint PK_FILEMORGUE primary key (TQUNID));
-        CREATE TABLE FILES(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, PARENTENTITYID text(50) null, BODY text null, BODYCONTENTTYPE text(100) null, ISOBSOLETE text(1) null, FILENAME text(300) not null, VISIBLENAME text(300) not null, VERSIONSTRING text(300) not null, DOCUMENTHASH text(40) not null, ISFINAL text(1) null, DOCREFERENCEID text(50) not null, constraint PK_FILES primary key (ISSUEID, OBJECTID));
-        CREATE TABLE FOLDERS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, CONTAINERNAME text(300) null, CONTAINERACLSETTINGS text null, constraint PK_FOLDERS primary key (ISSUEID, OBJECTID));
-        CREATE TABLE GLOBALSETTINGS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, SINGULARPROJECTLABEL text(30) not null, PLURALPROJECTLABEL text(30) not null, PROJECTREQUIRED text(1) not null, CUSTOMPROJECTSALLOWED text(1) not null, ACTIONITEMSPECXML text null, PROJECTLISTXML text null, ENTERPRISEDATALABELS text null, ENTERPRISEDATATABXSL text null, constraint PK_GLOBALSETTINGS primary key (ISSUEID, OBJECTID));
-        CREATE TABLE GLOBALSTRINGPROPERTIES(ID int not null, VALUE text(300) not null, constraint PK_GLOBALSTRINGPROPERTIES primary key (ID));
-        CREATE TABLE IMQ(TQUNID text(36) not null, DATETIMEQUEUED text(25) not null, ISSUEID text(50) not null, KUBIBUILD text(30) not null, FAILCOUNT int not null, LASTRUN text(25) null, ENVELOPESTREAM blob not null, PAYLOADSTREAM blob not null, constraint PK_IMQ primary key (TQUNID));
-        CREATE TABLE INVITATIONNODES(INVITATIONID text(50) not null, RECIPIENTNODEID text(50) not null, DATECREATED text(25) not null, constraint PK_INVITATIONNODES primary key (INVITATIONID, RECIPIENTNODEID));
-        CREATE TABLE INVITATIONS (id primary key, INVITATIONID text(50) not null, SENDERNODEID text(50) not null, RECIPIENTEMAILADDR text(200) not null, RECIPIENTUSERID text(50) null, RECIPIENTNODES text null, ISSUEID text(50) not null, ENVELOPE text not null, MESSAGEBLOB blob not null, INVITATIONSTATE int not null, TQUNID text(36) not null, DATECREATED text(25) not null);
-        CREATE TABLE ISSUES (CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, CONTAINERNAME text(300) null, CONTAINERACLSETTINGS text null, ISINITIALIZED text(1) null, BLINDINVITES text null, ISSYSTEMISSUE text(1) not null, ISSUETYPE int not null, ACTIVITYTYPEID text(50) null, ISINCOMPLETE text(1) not null, constraint PK_ISSUES primary key (ISSUEID, OBJECTID));
-        CREATE TABLE ISSUESETTINGS (CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, ISSUENAME text(300) not null, ISSUEACLSETTINGS text not null, ISSUEDUEDATE text(25) null, ISSUEPRIORITY int null, ISSUESTATUS int null, DESCRIPTION text null, PROJECTID text(100) null, PROJECTNAME text null, PROJECTNAMEISCUSTOM text(1) null, ISSYSTEMISSUE text(1) not null, ACTIONITEMREVNUM int not null, constraint PK_ISSUESETTINGS primary key (ISSUEID, OBJECTID));
-        CREATE TABLE KMTPMSG (MSGID integer not null, SENDERID text(50) null, RECIPIENTIDLIST text not null, ISSUEID text(50) null, MESSAGETYPE int not null, ENVELOPE text null, MESSAGEBLOB blob not null, RECEIVEDDATE text(25) not null, constraint PK_KMTPMSG primary key (MSGID));
-        CREATE TABLE KMTPNODEQ(id primary key, NODEID text(50) not null, MSGID int not null, RECEIVEDDATE text(25) not null, SENDCOUNT int not null);
-        CREATE TABLE KMTPQ(MSGID integer not null, SENDERID text(50) null, RECIPIENTIDLIST text not null, ISSUEID text(50) null, MESSAGETYPE int not null, ENVELOPE text null, MESSAGEBLOB blob not null, constraint PK_KMTPQ primary key (MSGID));
-        CREATE TABLE LOGENTRIES(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, PARENTENTITYID text(50) null, BODY text null, BODYCONTENTTYPE text(100) null, ISOBSOLETE text(1) null, ACTIONTYPE int not null, ASSOCIATEDOBJECTIDS text null, OLDENTITIES text null, NEWENTITIES text null, OTHERENTITIES text null, constraint PK_LOGENTRIES primary key (ISSUEID, OBJECTID));
-        CREATE TABLE LSBI(TQUNID text(36) not null, ISSUEID text(50) not null, TABLEITEMID text(50) null, TABLENODEID text(50) null, TABLECMD int null, TABLECONTAINERID text(50) null, TABLESEQNO int null, DIRTYCONTENT text null, STUBBED text(1) null, ENTITYSTUBDATA text null, UPDATENUMBER int not null, constraint PK_LSBI primary key (TQUNID));
-        CREATE TABLE LSBN(TQUNID text(36) not null, ISSUEID text(50) not null, NODEID text(50) not null, STORESEQNO int not null, SYNCSEQNO int not null, LASTMSGDATE text(25) null, constraint PK_LSBN primary key (TQUNID));
-        CREATE TABLE MMQ(TQUNID text(36) not null, ISSUEID text(50) not null, TABLEREQUESTNODE text(50) null, MMQENTRYINDEX text(60) null, DIRECTION int null, NODEID text(50) null, TABLEFIRSTSEQNO int null, TABLELASTSEQNO int null, NEXTRESENDTIMEOUT text(25) null, TABLETIMEOUTMULTIPLIER int null, constraint PK_MMQ primary key (TQUNID));
-        CREATE TABLE NODEREG(id primary key, NODEID text(50) not null, USERID text(50) null, CREATETIME text(25) not null, TQUNID text(36) not null);
-        CREATE TABLE NODES (id primary key, NODEID text(50) not null, USERID text(50) null, NODESTATE int not null, NODECERT text null, KUBIVERSION int not null, KUBIBUILD text(30) not null, TQUNID text(36) not null, LASTBINDDATE text(25) null, LASTUNBINDDATE text(25) null, LASTBINDIP text(15) null, NUMBINDS int not null, NUMSENDS int not null, NUMPOLLS int not null, NUMRECVS int not null);
-        CREATE TABLE PARTICIPANTNODES(id primary key, ISSUEID text(50) not null, OBJECTID text(50) not null, NODEID text(50) not null, USERID text(50) null, NODESTATE int not null, NODECERT text null, KUBIVERSION int not null, KUBIBUILD text(30) not null, TQUNID text(36) not null);
-        CREATE TABLE PARTICIPANTS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, PARTICIPANTSTATE int not null, PARTICIPANTROLE int not null, PARTICIPANTTEAM int not null, ISREQUIREDMEMBER text(1) null, USERID text(50) null, ISAGENT text(1) null, NAME text(150) not null, EMAILADDRESS text(200) not null, ISEMAILONLY text(1) not null, INVITATION text null, ACCEPTRESENDCOUNT int null, ACCEPTRESENDTIMEOUT text(25) null, ACCEPTLASTSENTTONODEID text(50) null, constraint PK_PARTICIPANTS primary key (ISSUEID, OBJECTID));
-        CREATE TABLE PARTICIPANTSETTINGS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, PARTICIPANTID text(50) not null, TASKPIMSYNC text(1) null, MOBILESUPPORT text(1) null, NOTIFYBYEMAIL text(1) null, MARKEDCRITICAL text(1) null, constraint PK_PARTICIPANTSETTINGS primary key (ISSUEID, OBJECTID));
-        CREATE TABLE PARTITIONS(id primary key, PARTITIONID text(50) not null, NAME text(100) not null, LDAPDN text(300) not null, SERVERNODEID text(50) not null, TQUNID text(36) not null);
-        CREATE TABLE PROJECTS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, NAME text(100) not null, ID text(100) null, constraint PK_PROJECTS primary key (ISSUEID, OBJECTID));
-        CREATE TABLE TASKCOMPLETIONS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, PARENTENTITYID text(50) null, BODY text null, BODYCONTENTTYPE text(100) null, ISOBSOLETE text(1) null, TASKID text(50) not null, DISPOSITION int not null, STATUSID text(50) not null, SHORTNAME text(30) not null, LONGNAME text(200) not null, constraint PK_TASKCOMPLETIONS primary key (ISSUEID, OBJECTID));
-        CREATE TABLE TASKS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, PARENTENTITYID text(50) null, BODY text null, BODYCONTENTTYPE text(100) null, ISOBSOLETE text(1) null, DUETIME text(25) null, ASSIGNEDTO text(50) not null, TARGETOBJECTIDS text null, RESPONSEID text(50) not null, TYPEID text(50) not null, LABEL text(200) not null, INSTRUCTIONS text not null, ALLOWEDSTATUSES text not null, ISSERIALREVIEW text(1) null, DAYSTOREVIEW int null, REVIEWERIDS text(500) null, REVIEWTYPE int null, REVIEWGROUP text(300) null, constraint PK_TASKS primary key (ISSUEID, OBJECTID));
-        CREATE TABLE USERS (id primary key, USERID text(50) not null, USERSID text(100) not null, ENTERPRISEUSER text(1) not null, USEREMAILADDRESS text(200) null, EMAILVALIDATED text(1) null, VALIDATIONCOOKIE text(50) null, CREATETIME text(25) not null, TQUNID text(36) not null, PARTITIONID text(50) null);
+        CREATE TABLE ACLS(ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, PARTICIPANTID varchar(50) not null, PERMISSIONBITS int not null, constraint PK_ACLS primary key (ISSUEID, OBJECTID, PARTICIPANTID));
+        CREATE TABLE ACTIONITEMSTATUSES(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, FRIENDLYNAME varchar(100) not null, REVISION int not null, SHORTNAME varchar(30) not null, LONGNAME varchar(200) not null, ATTACHMENTHANDLING int not null, RESULT int not null, NOTIFYCREATOR varchar(1) null, NOTIFYASSIGNEE varchar(1) null, NOTIFYFYI varchar(1) null, NOTIFYCLOSURETEAM varchar(1) null, NOTIFYCOORDINATORS varchar(1) null, COMMENTREQUIRED varchar(1) not null, constraint PK_ACTIONITEMSTATUSES primary key (ISSUEID, OBJECTID));
+        CREATE TABLE ACTIONITEMTYPES(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, REVISION int not null, LABEL varchar(200) not null, INSTRUCTIONS text not null, EMAILINSTRUCTIONS text null, ALLOWEDSTATUSES text not null, INITIALSTATUS varchar(100) not null, COMMENTREQUIRED varchar(1) not null, ATTACHMENTHANDLING int not null, constraint PK_ACTIONITEMTYPES primary key (ISSUEID, OBJECTID));
+        CREATE TABLE ATTACHMENTS(TQUNID varchar(36) not null, OBJECTID varchar(50) null, ISSUEID varchar(50) null, DATASTREAM blob not null, CONTENTENCODING varchar(50) null, CONTENTCHARSET varchar(50) null, CONTENTTYPE varchar(100) null, CONTENTID varchar(100) null, CONTENTLOCATION varchar(100) null, CONTENTNAME varchar(100) not null, constraint PK_ATTACHMENTS primary key (TQUNID));
+        CREATE TABLE COMPLIANCEPOLICIES(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, BODY text null, constraint PK_COMPLIANCEPOLICIES primary key (ISSUEID, OBJECTID));
+        CREATE TABLE DBHISTORY(id INT primary key, "DATETIME" varchar(25) not null, OPERATION varchar(20) not null, KUBIVERSION varchar(100) not null, FROMVERSION int null, TOVERSION int null);
+        CREATE TABLE DBINFO(id INT primary key, FINGERPRINT varchar(32) not null, VERSION int not null);
+        CREATE TABLE DETACHEDATTACHMENTS (TQUNID varchar(36) not null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, PATH varchar(300) not null, DETACHEDFILELASTMODTIMESTAMP varchar(25) null, CONTENTID varchar(100) not null, constraint PK_DETACHEDATTACHMENTS primary key (TQUNID));
+        CREATE TABLE DOCREFERENCES(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, REFERENCEDOCUMENTID varchar(50) null, constraint PK_DOCREFERENCES primary key (ISSUEID, OBJECTID));
+        CREATE TABLE DQ (TQUNID varchar(36) not null, ISSUEID varchar(50) not null, DEPENDSID varchar(50) null, DEPENDSTYPE int null, DEPENDSCOMMANDSTREAM blob null, DEPENDSNODEIDSEQNOKEY varchar(100) null, DEPENDSACLVERSION int null, constraint PK_DQ primary key (TQUNID));
+        CREATE TABLE EMAILQ(id INT primary key, TIMEQUEUED int not null, NODEID varchar(50) not null, MIME blob not null, TQUNID varchar(36) not null);
+        CREATE TABLE ENTERPRISEDATA(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, DATE1 varchar(25) null, DATE2 varchar(25) null, DATE3 varchar(25) null, DATE4 varchar(25) null, DATE5 varchar(25) null, DATE6 varchar(25) null, DATE7 varchar(25) null, DATE8 varchar(25) null, DATE9 varchar(25) null, DATE10 varchar(25) null, VALUE1 int null, VALUE2 int null, VALUE3 int null, VALUE4 int null, VALUE5 int null, VALUE6 int null, VALUE7 int null, VALUE8 int null, VALUE9 int null, VALUE10 int null, VALUE11 int null, VALUE12 int null, VALUE13 int null, VALUE14 int null, VALUE15 int null, VALUE16 int null, VALUE17 int null, VALUE18 int null, VALUE19 int null, VALUE20 int null, STRING1 varchar(300) null, STRING2 varchar(300) null, STRING3 varchar(300) null, STRING4 varchar(300) null, STRING5 varchar(300) null, STRING6 varchar(300) null, STRING7 varchar(300) null, STRING8 varchar(300) null, STRING9 varchar(300) null, STRING10 varchar(300) null, LONGSTRING1 text null, LONGSTRING2 text null, LONGSTRING3 text null, LONGSTRING4 text null, LONGSTRING5 text null, LONGSTRING6 text null, LONGSTRING7 text null, LONGSTRING8 text null, LONGSTRING9 text null, LONGSTRING10 text null, constraint PK_ENTERPRISEDATA primary key (ISSUEID, OBJECTID));
+        CREATE TABLE FILEMORGUE(TQUNID varchar(36) not null, PATH varchar(300) not null, DELETEFOLDERWHENEMPTY varchar(1) null, constraint PK_FILEMORGUE primary key (TQUNID));
+        CREATE TABLE FILES(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, PARENTENTITYID varchar(50) null, BODY text null, BODYCONTENTTYPE varchar(100) null, ISOBSOLETE varchar(1) null, FILENAME varchar(300) not null, VISIBLENAME varchar(300) not null, VERSIONSTRING varchar(300) not null, DOCUMENTHASH varchar(40) not null, ISFINAL varchar(1) null, DOCREFERENCEID varchar(50) not null, constraint PK_FILES primary key (ISSUEID, OBJECTID));
+        CREATE TABLE FOLDERS(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, CONTAINERNAME varchar(300) null, CONTAINERACLSETTINGS text null, constraint PK_FOLDERS primary key (ISSUEID, OBJECTID));
+        CREATE TABLE GLOBALSETTINGS(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, SINGULARPROJECTLABEL varchar(30) not null, PLURALPROJECTLABEL varchar(30) not null, PROJECTREQUIRED varchar(1) not null, CUSTOMPROJECTSALLOWED varchar(1) not null, ACTIONITEMSPECXML text null, PROJECTLISTXML text null, ENTERPRISEDATALABELS text null, ENTERPRISEDATATABXSL text null, constraint PK_GLOBALSETTINGS primary key (ISSUEID, OBJECTID));
+        CREATE TABLE GLOBALSTRINGPROPERTIES(ID int not null, VALUE varchar(300) not null, constraint PK_GLOBALSTRINGPROPERTIES primary key (ID));
+        CREATE TABLE IMQ(TQUNID varchar(36) not null, DATETIMEQUEUED varchar(25) not null, ISSUEID varchar(50) not null, KUBIBUILD varchar(30) not null, FAILCOUNT int not null, LASTRUN varchar(25) null, ENVELOPESTREAM blob not null, PAYLOADSTREAM blob not null, constraint PK_IMQ primary key (TQUNID));
+        CREATE TABLE INVITATIONNODES(INVITATIONID varchar(50) not null, RECIPIENTNODEID varchar(50) not null, DATECREATED varchar(25) not null, constraint PK_INVITATIONNODES primary key (INVITATIONID, RECIPIENTNODEID));
+        CREATE TABLE INVITATIONS (id INT primary key, INVITATIONID varchar(50) not null, SENDERNODEID varchar(50) not null, RECIPIENTEMAILADDR varchar(200) not null, RECIPIENTUSERID varchar(50) null, RECIPIENTNODES text null, ISSUEID varchar(50) not null, ENVELOPE text not null, MESSAGEBLOB blob not null, INVITATIONSTATE int not null, TQUNID varchar(36) not null, DATECREATED varchar(25) not null);
+        CREATE TABLE ISSUES (CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, CONTAINERNAME varchar(300) null, CONTAINERACLSETTINGS text null, ISINITIALIZED varchar(1) null, BLINDINVITES text null, ISSYSTEMISSUE varchar(1) not null, ISSUETYPE int not null, ACTIVITYTYPEID varchar(50) null, ISINCOMPLETE varchar(1) not null, constraint PK_ISSUES primary key (ISSUEID, OBJECTID));
+        CREATE TABLE ISSUESETTINGS (CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, ISSUENAME varchar(300) not null, ISSUEACLSETTINGS text not null, ISSUEDUEDATE varchar(25) null, ISSUEPRIORITY int null, ISSUESTATUS int null, DESCRIPTION text null, PROJECTID varchar(100) null, PROJECTNAME text null, PROJECTNAMEISCUSTOM varchar(1) null, ISSYSTEMISSUE varchar(1) not null, ACTIONITEMREVNUM int not null, constraint PK_ISSUESETTINGS primary key (ISSUEID, OBJECTID));
+        CREATE TABLE KMTPMSG (MSGID integer not null, SENDERID varchar(50) null, RECIPIENTIDLIST text not null, ISSUEID varchar(50) null, MESSAGETYPE int not null, ENVELOPE text null, MESSAGEBLOB blob not null, RECEIVEDDATE varchar(25) not null, constraint PK_KMTPMSG primary key (MSGID));
+        CREATE TABLE KMTPNODEQ(id INT primary key, NODEID varchar(50) not null, MSGID int not null, RECEIVEDDATE varchar(25) not null, SENDCOUNT int not null);
+        CREATE TABLE KMTPQ(MSGID integer not null, SENDERID varchar(50) null, RECIPIENTIDLIST text not null, ISSUEID varchar(50) null, MESSAGETYPE int not null, ENVELOPE text null, MESSAGEBLOB blob not null, constraint PK_KMTPQ primary key (MSGID));
+        CREATE TABLE LOGENTRIES(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, PARENTENTITYID varchar(50) null, BODY text null, BODYCONTENTTYPE varchar(100) null, ISOBSOLETE varchar(1) null, ACTIONTYPE int not null, ASSOCIATEDOBJECTIDS text null, OLDENTITIES text null, NEWENTITIES text null, OTHERENTITIES text null, constraint PK_LOGENTRIES primary key (ISSUEID, OBJECTID));
+        CREATE TABLE LSBI(TQUNID varchar(36) not null, ISSUEID varchar(50) not null, TABLEITEMID varchar(50) null, TABLENODEID varchar(50) null, TABLECMD int null, TABLECONTAINERID varchar(50) null, TABLESEQNO int null, DIRTYCONTENT text null, STUBBED varchar(1) null, ENTITYSTUBDATA text null, UPDATENUMBER int not null, constraint PK_LSBI primary key (TQUNID));
+        CREATE TABLE LSBN(TQUNID varchar(36) not null, ISSUEID varchar(50) not null, NODEID varchar(50) not null, STORESEQNO int not null, SYNCSEQNO int not null, LASTMSGDATE varchar(25) null, constraint PK_LSBN primary key (TQUNID));
+        CREATE TABLE MMQ(TQUNID varchar(36) not null, ISSUEID varchar(50) not null, TABLEREQUESTNODE varchar(50) null, MMQENTRYINDEX varchar(60) null, DIRECTION int null, NODEID varchar(50) null, TABLEFIRSTSEQNO int null, TABLELASTSEQNO int null, NEXTRESENDTIMEOUT varchar(25) null, TABLETIMEOUTMULTIPLIER int null, constraint PK_MMQ primary key (TQUNID));
+        CREATE TABLE NODEREG(id INT primary key, NODEID varchar(50) not null, USERID varchar(50) null, CREATETIME varchar(25) not null, TQUNID varchar(36) not null);
+        CREATE TABLE NODES (id INT primary key, NODEID varchar(50) not null, USERID varchar(50) null, NODESTATE int not null, NODECERT text null, KUBIVERSION int not null, KUBIBUILD varchar(30) not null, TQUNID varchar(36) not null, LASTBINDDATE varchar(25) null, LASTUNBINDDATE varchar(25) null, LASTBINDIP varchar(15) null, NUMBINDS int not null, NUMSENDS int not null, NUMPOLLS int not null, NUMRECVS int not null);
+        CREATE TABLE PARTICIPANTNODES(id INT primary key, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, NODEID varchar(50) not null, USERID varchar(50) null, NODESTATE int not null, NODECERT text null, KUBIVERSION int not null, KUBIBUILD varchar(30) not null, TQUNID varchar(36) not null);
+        CREATE TABLE PARTICIPANTS(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, PARTICIPANTSTATE int not null, PARTICIPANTROLE int not null, PARTICIPANTTEAM int not null, ISREQUIREDMEMBER varchar(1) null, USERID varchar(50) null, ISAGENT varchar(1) null, NAME varchar(150) not null, EMAILADDRESS varchar(200) not null, ISEMAILONLY varchar(1) not null, INVITATION text null, ACCEPTRESENDCOUNT int null, ACCEPTRESENDTIMEOUT varchar(25) null, ACCEPTLASTSENTTONODEID varchar(50) null, constraint PK_PARTICIPANTS primary key (ISSUEID, OBJECTID));
+        CREATE TABLE PARTICIPANTSETTINGS(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, PARTICIPANTID varchar(50) not null, TASKPIMSYNC varchar(1) null, MOBILESUPPORT varchar(1) null, NOTIFYBYEMAIL varchar(1) null, MARKEDCRITICAL varchar(1) null, constraint PK_PARTICIPANTSETTINGS primary key (ISSUEID, OBJECTID));
+        CREATE TABLE PARTITIONS(id INT primary key, PARTITIONID varchar(50) not null, NAME varchar(100) not null, LDAPDN varchar(300) not null, SERVERNODEID varchar(50) not null, TQUNID varchar(36) not null);
+        CREATE TABLE PROJECTS(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, NAME varchar(100) not null, ID varchar(100) null, constraint PK_PROJECTS primary key (ISSUEID, OBJECTID));
+        CREATE TABLE TASKCOMPLETIONS(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, PARENTENTITYID varchar(50) null, BODY text null, BODYCONTENTTYPE varchar(100) null, ISOBSOLETE varchar(1) null, TASKID varchar(50) not null, DISPOSITION int not null, STATUSID varchar(50) not null, SHORTNAME varchar(30) not null, LONGNAME varchar(200) not null, constraint PK_TASKCOMPLETIONS primary key (ISSUEID, OBJECTID));
+        CREATE TABLE TASKS(CLASSID int null, SEQNO int not null, LASTMODONNODEID varchar(50) not null, PREVMODONNODEID varchar(50) null, ISSUEID varchar(50) not null, OBJECTID varchar(50) not null, REVISIONNUM int not null, CONTAINERID varchar(50) not null, AUTHORID varchar(50) not null, CREATIONDATE varchar(25) null, LASTMODIFIEDDATE varchar(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD varchar(300) null, LASTMODIFIEDBYID varchar(50) null, PARENTENTITYID varchar(50) null, BODY text null, BODYCONTENTTYPE varchar(100) null, ISOBSOLETE varchar(1) null, DUETIME varchar(25) null, ASSIGNEDTO varchar(50) not null, TARGETOBJECTIDS text null, RESPONSEID varchar(50) not null, TYPEID varchar(50) not null, LABEL varchar(200) not null, INSTRUCTIONS text not null, ALLOWEDSTATUSES text not null, ISSERIALREVIEW varchar(1) null, DAYSTOREVIEW int null, REVIEWERIDS varchar(500) null, REVIEWTYPE int null, REVIEWGROUP varchar(300) null, constraint PK_TASKS primary key (ISSUEID, OBJECTID));
+        CREATE TABLE USERS (id INT primary key, USERID varchar(50) not null, USERSID varchar(100) not null, ENTERPRISEUSER varchar(1) not null, USEREMAILADDRESS varchar(200) null, EMAILVALIDATED varchar(1) null, VALIDATIONCOOKIE varchar(50) null, CREATETIME varchar(25) not null, TQUNID varchar(36) not null, PARTITIONID varchar(50) null);
         CREATE VIEW CRITICALISSUES as
 
 
diff --git a/test/sql-tap/tkt1473.test.lua b/test/sql-tap/tkt1473.test.lua
index b2468d93f..d6bf388be 100755
--- a/test/sql-tap/tkt1473.test.lua
+++ b/test/sql-tap/tkt1473.test.lua
@@ -25,7 +25,7 @@ test:plan(57)
 test:do_execsql_test(
     "tkt1473-1.1",
     [[
-        CREATE TABLE t1(a primary key,b);
+        CREATE TABLE t1(a INT primary key,b INT);
         INSERT INTO t1 VALUES(1,2);
         INSERT INTO t1 VALUES(3,4);
         SELECT * FROM t1
@@ -290,7 +290,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt1473-4.1",
     [[
-        CREATE TABLE t2(x primary key,y);
+        CREATE TABLE t2(x INT primary key,y INT);
         INSERT INTO t2 VALUES(1,2);
         INSERT INTO t2 SELECT x+2, y+2 FROM t2;
         INSERT INTO t2 SELECT x+4, y+4 FROM t2;
diff --git a/test/sql-tap/tkt1501.test.lua b/test/sql-tap/tkt1501.test.lua
index 3e1ed1e0d..23b0a798d 100755
--- a/test/sql-tap/tkt1501.test.lua
+++ b/test/sql-tap/tkt1501.test.lua
@@ -25,7 +25,7 @@ test:plan(1)
 test:do_execsql_test(
     "tkt1501-1.1",
     [[
-        CREATE TABLE t1(a primary key,b);
+        CREATE TABLE t1(a INT primary key,b INT);
         INSERT INTO t1 VALUES(1,2);
         SELECT a, b, 'abc' FROM t1
           UNION
diff --git a/test/sql-tap/tkt1514.test.lua b/test/sql-tap/tkt1514.test.lua
index 025c1065f..83b8891e6 100755
--- a/test/sql-tap/tkt1514.test.lua
+++ b/test/sql-tap/tkt1514.test.lua
@@ -23,7 +23,7 @@ test:plan(1)
 test:do_catchsql_test(
     "tkt1514-1.1",
     [[
-        CREATE TABLE t1(a primary key,b);
+        CREATE TABLE t1(a INT primary key,b INT);
         SELECT a FROM t1 WHERE max(b)<10 GROUP BY a;
     ]], {
         -- <tkt1514-1.1>
diff --git a/test/sql-tap/tkt1537.test.lua b/test/sql-tap/tkt1537.test.lua
index caa428409..8a53932c9 100755
--- a/test/sql-tap/tkt1537.test.lua
+++ b/test/sql-tap/tkt1537.test.lua
@@ -23,10 +23,10 @@ test:plan(15)
 test:do_execsql_test(
     "tkt1537-1.1",
     [[
-        CREATE TABLE t1(id primary key, a1, a2);
+        CREATE TABLE t1(id INT primary key, a1 INT, a2 INT);
         INSERT INTO t1 VALUES(1, NULL, NULL);
         INSERT INTO t1 VALUES(2, 1, 3);
-        CREATE TABLE t2(id primary key, b);
+        CREATE TABLE t2(id INT primary key, b INT);
         INSERT INTO t2 VALUES(3, 1);
         INSERT INTO t2 VALUES(4, NULL);
         SELECT * FROM t1 LEFT JOIN t2 ON a1=b OR a2=+b;
diff --git a/test/sql-tap/tkt2141.test.lua b/test/sql-tap/tkt2141.test.lua
index a08b6af68..3ce9d77db 100755
--- a/test/sql-tap/tkt2141.test.lua
+++ b/test/sql-tap/tkt2141.test.lua
@@ -27,11 +27,11 @@ test:plan(3)
 test:do_execsql_test(
     "tkt2141-1.1",
     [[
-        CREATE TABLE tab1 (t1_id integer PRIMARY KEY, t1_desc);
+        CREATE TABLE tab1 (t1_id integer PRIMARY KEY, t1_desc TEXT);
         INSERT INTO tab1 VALUES(1,'rec 1 tab 1');
-        CREATE TABLE tab2 (t2_id integer PRIMARY KEY, t2_id_t1, t2_desc);
+        CREATE TABLE tab2 (t2_id integer PRIMARY KEY, t2_id_t1 INT , t2_desc TEXT);
         INSERT INTO tab2 VALUES(1,1,'rec 1 tab 2');
-        CREATE TABLE tab3 (t3_id integer PRIMARY KEY, t3_id_t2, t3_desc);
+        CREATE TABLE tab3 (t3_id integer PRIMARY KEY, t3_id_t2 INT , t3_desc TEXT);
         INSERT INTO tab3 VALUES(1,1,'aa');
         SELECT *
         FROM tab1 t1 LEFT JOIN tab2 t2 ON t1.t1_id = t2.t2_id_t1
diff --git a/test/sql-tap/tkt2192.test.lua b/test/sql-tap/tkt2192.test.lua
index 7e96e0ce4..c76a9e5c2 100755
--- a/test/sql-tap/tkt2192.test.lua
+++ b/test/sql-tap/tkt2192.test.lua
@@ -109,7 +109,7 @@ test:do_test(
 test:do_execsql_test(
     "tkt2192-2.1",
     [[
-        CREATE TABLE t1(a,b primary key);
+        CREATE TABLE t1(a INT ,b  INT primary key);
         CREATE VIEW v1 AS
           SELECT * FROM t1 WHERE b%7=0 UNION SELECT * FROM t1 WHERE b%5=0;
         INSERT INTO t1 VALUES(1,7);
diff --git a/test/sql-tap/tkt2339.test.lua b/test/sql-tap/tkt2339.test.lua
index 8129d1cbf..0f25303a7 100755
--- a/test/sql-tap/tkt2339.test.lua
+++ b/test/sql-tap/tkt2339.test.lua
@@ -23,21 +23,21 @@ test:plan(9)
 test:do_execsql_test(
     "tkt2339.1",
     [[
-        create table t1(num int primary key);
+        create table t1(numb int primary key);
         insert into t1 values (1);
         insert into t1 values (2);
         insert into t1 values (3);
         insert into t1 values (4);
 
-        create table t2(num int primary key);
+        create table t2(numb int primary key);
         insert into t2 values (11);
         insert into t2 values (12);
         insert into t2 values (13);
         insert into t2 values (14);
 
-        SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t1 ORDER BY numb DESC LIMIT 2)
         UNION
-        SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t2 ORDER BY numb DESC LIMIT 2)
     ]], {
         -- <tkt2339.1>
         3, 4, 13, 14
@@ -47,9 +47,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2339.2",
     [[
-        SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t1 ORDER BY numb DESC LIMIT 2)
         UNION ALL
-        SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t2 ORDER BY numb DESC LIMIT 2)
     ]], {
         -- <tkt2339.2>
         4, 3, 14, 13
@@ -59,9 +59,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2339.3",
     [[
-        SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC)
+        SELECT * FROM (SELECT * FROM t1 ORDER BY numb DESC)
         UNION ALL
-        SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t2 ORDER BY numb DESC LIMIT 2)
     ]], {
         -- <tkt2339.3>
         4, 3, 2, 1, 14, 13
@@ -71,9 +71,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2339.4",
     [[
-        SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t1 ORDER BY numb DESC LIMIT 2)
         UNION ALL
-        SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC)
+        SELECT * FROM (SELECT * FROM t2 ORDER BY numb DESC)
     ]], {
         -- <tkt2339.4>
         4, 3, 14, 13, 12, 11
@@ -83,9 +83,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2339.5",
     [[
-        SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t1 ORDER BY numb DESC LIMIT 2)
         UNION
-        SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC)
+        SELECT * FROM (SELECT * FROM t2 ORDER BY numb DESC)
     ]], {
         -- <tkt2339.5>
         3, 4, 11, 12, 13, 14
@@ -95,9 +95,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2339.6",
     [[
-        SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t1 ORDER BY numb DESC LIMIT 2)
         EXCEPT
-        SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC)
+        SELECT * FROM (SELECT * FROM t2 ORDER BY numb DESC)
     ]], {
         -- <tkt2339.6>
         3, 4
@@ -109,7 +109,7 @@ test:do_execsql_test(
     [[
         SELECT * FROM (SELECT * FROM t1 LIMIT 2)
         UNION
-        SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t2 ORDER BY numb DESC LIMIT 2)
     ]], {
         -- <tkt2339.7>
         1, 2, 13, 14
@@ -131,7 +131,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2339.9",
     [[
-        SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
+        SELECT * FROM (SELECT * FROM t1 ORDER BY numb DESC LIMIT 2)
         UNION
         SELECT * FROM (SELECT * FROM t2 LIMIT 2)
     ]], {
diff --git a/test/sql-tap/tkt2391.test.lua b/test/sql-tap/tkt2391.test.lua
index 1ccd922ab..7fa5e1634 100755
--- a/test/sql-tap/tkt2391.test.lua
+++ b/test/sql-tap/tkt2391.test.lua
@@ -20,7 +20,7 @@ test:plan(4)
 test:do_execsql_test(
     "tkt2391.1",
     [[
-        CREATE TABLE folders(folderid, parentid, foldername COLLATE binary primary key);
+        CREATE TABLE folders(folderid INT , parentid INT , foldername TEXT COLLATE binary primary key);
         INSERT INTO folders VALUES(1, 3, 'FolderA');
         INSERT INTO folders VALUES(1, 3, 'folderB');
         INSERT INTO folders VALUES(4, 0, 'FolderC');
diff --git a/test/sql-tap/tkt2640.test.lua b/test/sql-tap/tkt2640.test.lua
index fa32b5e0d..2f3af1d80 100755
--- a/test/sql-tap/tkt2640.test.lua
+++ b/test/sql-tap/tkt2640.test.lua
@@ -35,16 +35,16 @@ test:plan(6)
 test:do_execsql_test(
     "tkt2640-1.1",
     [[
-        CREATE TABLE persons(person_id primary key, name);
+        CREATE TABLE persons(person_id  INT primary key, name TEXT);
         INSERT INTO persons VALUES(1,'fred');
         INSERT INTO persons VALUES(2,'barney');
         INSERT INTO persons VALUES(3,'wilma');
         INSERT INTO persons VALUES(4,'pebbles');
         INSERT INTO persons VALUES(5,'bambam');
-        CREATE TABLE directors(id primary key, person_id);
+        CREATE TABLE directors(id  INT primary key, person_id INT );
         INSERT INTO directors VALUES(1, 5);
         INSERT INTO directors VALUES(2, 3);
-        CREATE TABLE writers(person_id primary key);
+        CREATE TABLE writers(person_id  INT primary key);
         INSERT INTO writers VALUES(2);
         INSERT INTO writers VALUES(3);
         INSERT INTO writers VALUES(4);
diff --git a/test/sql-tap/tkt2767.test.lua b/test/sql-tap/tkt2767.test.lua
index 36d8f6c8c..066c82100 100755
--- a/test/sql-tap/tkt2767.test.lua
+++ b/test/sql-tap/tkt2767.test.lua
@@ -31,7 +31,7 @@ if (1 > 0)
         "tkt2767-1.1",
         [[
             -- Construct a table with many rows of data
-            CREATE TABLE t1(x primary key);
+            CREATE TABLE t1(x  INT primary key);
             INSERT INTO t1 VALUES(1);
             INSERT INTO t1 VALUES(2);
             INSERT INTO t1 SELECT x+2 FROM t1;
diff --git a/test/sql-tap/tkt2822.test.lua b/test/sql-tap/tkt2822.test.lua
index bb846b56b..40d5ec212 100755
--- a/test/sql-tap/tkt2822.test.lua
+++ b/test/sql-tap/tkt2822.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(37)
+test:plan(36)
 
 --!./tcltestrunner.lua
 -- 2007 Dec 4
@@ -62,8 +62,8 @@ test:plan(37)
 test:do_execsql_test(
     "tkt2822-0.1",
     [[
-        CREATE TABLE t1(a primary key, b, c);
-        CREATE TABLE t2(a primary key, b, c);
+        CREATE TABLE t1(a  INT primary key, b INT , c INT );
+        CREATE TABLE t2(a  INT primary key, b INT , c INT );
 
         INSERT INTO t1 VALUES(1, 3, 9);
         INSERT INTO t1 VALUES(3, 9, 27);
@@ -217,19 +217,6 @@ test:do_catchsql_test(
         -- </tkt2822-4.1>
     })
 
-test:do_catchsql_test(
-    "tkt2822-4.2",
-    [[
-        SELECT a, CAST (b AS TEXT) AS x, c FROM t1 
-          UNION ALL 
-        SELECT a, b, c FROM t2 
-          ORDER BY CAST (b AS INTEGER);
-    ]], {
-        -- <tkt2822-4.2>
-        1, "1st ORDER BY term does not match any column in the result set"
-        -- </tkt2822-4.2>
-    })
-
 -- Tests for rule (2).
 --
 -- The "ORDER BY b" should match the column alias (rule 2), not the
@@ -238,7 +225,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "tkt2822-5.1",
     [[
-        CREATE TABLE t3(a primary key,b);
+        CREATE TABLE t3(a  INT primary key,b INT );
         INSERT INTO t3 VALUES(1,8);
         INSERT INTO t3 VALUES(9,2);
 
@@ -294,10 +281,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2822-6.1",
     [[
-        CREATE TABLE t6a(p primary key,q);
+        CREATE TABLE t6a(p  INT primary key,q INT );
         INSERT INTO t6a VALUES(1,8);
         INSERT INTO t6a VALUES(9,2);
-        CREATE TABLE t6b(x primary key,y);
+        CREATE TABLE t6b(x  INT primary key,y INT );
         INSERT INTO t6b VALUES(1,7);
         INSERT INTO t6b VALUES(7,2);
 
@@ -371,8 +358,8 @@ test:do_test(
     "tkt2822-7.1",
     function()
         test:execsql [[
-            CREATE TABLE t7(a1 primary key,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,
-                            a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25);
+            CREATE TABLE t7(a1  INT primary key,a2 INT ,a3 INT ,a4 INT ,a5 INT ,a6 INT ,a7 INT ,a8 INT ,a9 INT ,a10 INT ,a11 INT ,a12 INT ,a13 INT ,a14 INT ,
+                            a15 INT ,a16 INT ,a17 INT ,a18 INT ,a19 INT ,a20 INT ,a21 INT ,a22 INT ,a23 INT ,a24 INT ,a25 INT );
         ]]
         return test:catchsql [[
             SELECT * FROM t7 ORDER BY 0;
diff --git a/test/sql-tap/tkt2832.test.lua b/test/sql-tap/tkt2832.test.lua
index 95cd1b5c2..108c05cdb 100755
--- a/test/sql-tap/tkt2832.test.lua
+++ b/test/sql-tap/tkt2832.test.lua
@@ -25,7 +25,7 @@ test:plan(6)
 test:do_execsql_test(
     "tkt2832-1.1",
     [[
-        CREATE TABLE t1(a PRIMARY KEY);
+        CREATE TABLE t1(a INT PRIMARY KEY);
         INSERT INTO t1 VALUES(2);
         INSERT INTO t1 VALUES(1);
         INSERT INTO t1 VALUES(3);
@@ -50,7 +50,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2832-2.1",
     [[
-        CREATE TABLE t2(a primary key, b);
+        CREATE TABLE t2(a INT primary key, b INT);
         CREATE TRIGGER t2_t AFTER UPDATE ON t2 BEGIN
           DELETE FROM t2 WHERE a = new.a + 1;
         END;
@@ -75,7 +75,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2832-3.1",
     [[
-        CREATE TABLE t3(a primary key, b);
+        CREATE TABLE t3(a INT primary key, b INT);
         CREATE TRIGGER t3_t AFTER DELETE ON t3 BEGIN
           DELETE FROM t3 WHERE a = old.a + 1;
         END;
diff --git a/test/sql-tap/tkt2927.test.lua b/test/sql-tap/tkt2927.test.lua
index 8a31bc63f..897e0777b 100755
--- a/test/sql-tap/tkt2927.test.lua
+++ b/test/sql-tap/tkt2927.test.lua
@@ -28,7 +28,7 @@ test:do_test(
     "tkt2927-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a primary key, b);
+            CREATE TABLE t1(a  INT primary key, b INT );
             INSERT INTO t1 VALUES(1,11);
             INSERT INTO t1 VALUES(2,22);
             INSERT INTO t1 VALUES(3,33);
@@ -1204,12 +1204,12 @@ test:do_test(
             CREATE TABLE host (
              hostname text not null primary key,
              consoleHost text,
-             consolePort text
+             consolePort int
             );
-            INSERT INTO host VALUES('aald04','aalp03','4');
-            INSERT INTO host VALUES('aald17','aalp01','1');
+            INSERT INTO host VALUES('aald04','aalp03',4);
+            INSERT INTO host VALUES('aald17','aalp01',1);
             CREATE VIEW consolemap1a as
-              select hostname, consolehost, '/dev/cuaD0.' || (consoleport-1) consoleport
+              select hostname, consolehost, '/dev/cuaD0.' || cast(consoleport-1 as text) consoleport
                 from host where consolehost='aalp01';
             CREATE VIEW consolemap1b as
               select hostname hostname, consolehost consolehost, '/dev/cuaD' ||
diff --git a/test/sql-tap/tkt2942.test.lua b/test/sql-tap/tkt2942.test.lua
index 6ee354617..f83d30c2b 100755
--- a/test/sql-tap/tkt2942.test.lua
+++ b/test/sql-tap/tkt2942.test.lua
@@ -35,12 +35,12 @@ test:plan(4)
 test:do_execsql_test(
     "tkt2942.1",
     [[
-        create table t1(id primary key, num int);
+        create table t1(id  INT primary key, "num" int);
         insert into t1 values (1, 2);
         insert into t1 values (2, 1);
         insert into t1 values (3, 3);
         insert into t1 values (4, 4);
-        SELECT group_concat(num) FROM (SELECT num FROM t1 ORDER BY num DESC);
+        SELECT group_concat("num") FROM (SELECT "num" FROM t1 ORDER BY "num" DESC);
     ]], {
         -- <tkt2942.1>
         "4,3,2,1"
@@ -50,7 +50,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2942.2",
     [[
-        SELECT group_concat(num) FROM (SELECT num FROM t1 ORDER BY num);
+        SELECT group_concat("num") FROM (SELECT "num" FROM t1 ORDER BY "num");
     ]], {
         -- <tkt2942.2>
         "1,2,3,4"
@@ -60,7 +60,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2942.3",
     [[
-        SELECT group_concat(num) FROM (SELECT num FROM t1);
+        SELECT group_concat("num") FROM (SELECT "num" FROM t1);
     ]], {
         -- <tkt2942.3>
         "2,1,3,4"
@@ -70,7 +70,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt2942.4",
     [[
-        SELECT group_concat(num) FROM (SELECT num FROM t1 ORDER BY id DESC);
+        SELECT group_concat("num") FROM (SELECT "num" FROM t1 ORDER BY id DESC);
     ]], {
         -- <tkt2942.4>
         "4,3,1,2"
diff --git a/test/sql-tap/tkt3201.test.lua b/test/sql-tap/tkt3201.test.lua
index a16cfb980..33700b886 100755
--- a/test/sql-tap/tkt3201.test.lua
+++ b/test/sql-tap/tkt3201.test.lua
@@ -118,8 +118,8 @@ test:do_test(
     "tkt3201-4.0",
     function()
         return test:execsql [[
-            CREATE TABLE t4(x primary key);
-            CREATE TABLE t4_log(x primary key);
+            CREATE TABLE t4(x  INT primary key);
+            CREATE TABLE t4_log(x  INT primary key);
             CREATE TRIGGER r4_1 AFTER INSERT ON t4 WHEN new.x=1 BEGIN
               INSERT INTO t4_log(x) VALUES(new.x);
             END;
diff --git a/test/sql-tap/tkt3298.test.lua b/test/sql-tap/tkt3298.test.lua
index 11eb00f65..d7553d4b8 100755
--- a/test/sql-tap/tkt3298.test.lua
+++ b/test/sql-tap/tkt3298.test.lua
@@ -94,10 +94,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt3298-2.1",
     [[
-        CREATE TABLE t2(p primary key,q);
+        CREATE TABLE t2(p  INT primary key,q INT );
         INSERT INTO t2 VALUES(1,11);
         INSERT INTO t2 VALUES(2,22);
-        CREATE TABLE t3(x primary key,y);
+        CREATE TABLE t3(x  INT primary key,y TEXT);
         INSERT INTO t3 VALUES(1,'one');
 
         SELECT *, (SELECT z FROM (SELECT y AS z FROM t3 WHERE x=t1.a+1) ) FROM t1;
diff --git a/test/sql-tap/tkt3334.test.lua b/test/sql-tap/tkt3334.test.lua
index 10a2393eb..9895cd0be 100755
--- a/test/sql-tap/tkt3334.test.lua
+++ b/test/sql-tap/tkt3334.test.lua
@@ -24,7 +24,7 @@ test:plan(11)
 test:do_execsql_test(
     "tkt3334-1.0",
     [[
-        CREATE TABLE t1(id primary key, a,b);
+        CREATE TABLE t1(id  INT primary key, a INT ,b INT );
         INSERT INTO t1 VALUES(1, 1,934);
         INSERT INTO t1 VALUES(2, 2,221);
         INSERT INTO t1 VALUES(3, 1,372);
diff --git a/test/sql-tap/tkt3346.test.lua b/test/sql-tap/tkt3346.test.lua
index 1e8bd2ca6..27ca72bb7 100755
--- a/test/sql-tap/tkt3346.test.lua
+++ b/test/sql-tap/tkt3346.test.lua
@@ -24,7 +24,7 @@ test:do_test(
     "tkt3346-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(id primary key, a,b);
+            CREATE TABLE t1(id  INT primary key, a INT ,b TEXT);
             INSERT INTO t1 VALUES(1, 2,'bob');
             INSERT INTO t1 VALUES(2, 1,'alice');
             INSERT INTO t1 VALUES(3, 3,'claire');
@@ -55,7 +55,7 @@ test:do_test(
     function()
         return test:execsql [[
             SELECT b FROM (SELECT a,b FROM t1 ORDER BY a) AS x
-             WHERE (SELECT y FROM (SELECT a||b y FROM t1 WHERE t1.b=x.b))=(x.a||x.b)
+             WHERE (SELECT y FROM (SELECT CAST(a AS TEXT)||b y FROM t1 WHERE t1.b=x.b))=(CAST(x.a AS TEXT)||x.b)
         ]]
     end, {
         -- <tkt3346-1.3>
@@ -68,7 +68,7 @@ test:do_test(
     function()
         return test:execsql [[
             SELECT b FROM (SELECT a,b FROM t1 ORDER BY a) AS x
-             WHERE (SELECT y FROM (SELECT a||b y FROM t1 WHERE t1.b=x.b))=('2'||x.b)
+             WHERE (SELECT y FROM (SELECT CAST(a AS TEXT)||b y FROM t1 WHERE t1.b=x.b))=('2'||x.b)
         ]]
     end, {
         -- <tkt3346-1.4>
@@ -88,7 +88,7 @@ test:do_test(
 test:do_catchsql_test(
     "tkt3346-2.1",
     [[
-        CREATE TABLE t2(a primary key);
+        CREATE TABLE t2(a  INT primary key);
         INSERT INTO t2 VALUES(1);
 
         SELECT * FROM (SELECT a,b FROM t1 WHERE 1=x.a) AS x;
diff --git a/test/sql-tap/tkt3357.test.lua b/test/sql-tap/tkt3357.test.lua
index d302639eb..4424afd27 100755
--- a/test/sql-tap/tkt3357.test.lua
+++ b/test/sql-tap/tkt3357.test.lua
@@ -23,8 +23,8 @@ test:plan(4)
 test:do_execsql_test(
     "tkt3357-1.1",
     [[
-        create table a(id integer primary key, b_id integer, myvalue varchar);
-        create table b(id integer primary key, bvalue varchar);
+        create table a(id integer primary key, b_id integer, myvalue text);
+        create table b(id integer primary key, bvalue text);
         insert into a values(1, 1,'Test');
         insert into a values(2, 1,'Test2');
         insert into a values(3, 1,'Test3');
diff --git a/test/sql-tap/tkt3424.test.lua b/test/sql-tap/tkt3424.test.lua
index 370677fb9..2bbd226b3 100755
--- a/test/sql-tap/tkt3424.test.lua
+++ b/test/sql-tap/tkt3424.test.lua
@@ -25,7 +25,7 @@ test:do_execsql_test(
         INSERT INTO names VALUES(1,'E1','AAA');
         INSERT INTO names VALUES(2,NULL,'BBB');
 
-        CREATE TABLE orig(id primary key, code TEXT, data TEXT);
+        CREATE TABLE orig(id INT primary key, code TEXT, data TEXT);
         INSERT INTO orig VALUES(1, 'AAA','E1');
         INSERT INTO orig VALUES(2, 'AAA','E2');
         INSERT INTO orig VALUES(3, 'AAA','E3');
diff --git a/test/sql-tap/tkt3442.test.lua b/test/sql-tap/tkt3442.test.lua
index 102679292..f511f6a68 100755
--- a/test/sql-tap/tkt3442.test.lua
+++ b/test/sql-tap/tkt3442.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(5)
+test:plan(4)
 
 --!./tcltestrunner.lua
 -- 2008 October 20
@@ -45,9 +45,9 @@ local function EQP(sql)
     return test:execsql("EXPLAIN QUERY PLAN "..sql)
 end
 
--- These tests perform an EXPLAIN QUERY PLAN on both versions of the 
--- SELECT referenced in ticket #3442 (both '5000' and "5000") 
--- and verify that the query plan is the same.
+-- These tests perform an EXPLAIN QUERY PLAN on both versions of
+-- SELECT: with string literal and numeric constant and verify
+-- that the query plans are different.
 --
 test:do_test(
     "tkt3442-1.2",
@@ -62,34 +62,18 @@ test:do_test(
 test:do_test(
     "tkt3442-1.3",
     function()
-        return EQP([[ SELECT node FROM listhash WHERE id='5000' LIMIT 1; ]])
+        return EQP([[ SELECT node FROM listhash WHERE id=5000 LIMIT 1; ]])
     end, {
         -- <tkt3442-1.3>
-        0, 0, 0, "SEARCH TABLE LISTHASH USING COVERING INDEX IDIDX (ID=?)"
+        0, 0, 0, "SCAN TABLE LISTHASH"
         -- </tkt3442-1.3>
     })
 
-
-
--- Some extra tests testing other permutations of 5000.
---
-test:do_test(
-    "tkt3442-1.4",
-    function()
-        return EQP(" SELECT node FROM listhash WHERE id=5000 LIMIT 1; ")
-    end, {
-        -- <tkt3442-1.4>
-        0, 0, 0, "SEARCH TABLE LISTHASH USING COVERING INDEX IDIDX (ID=?)"
-        -- </tkt3442-1.4>
-    })
-
-
-
 test:do_catchsql_test(
-    "tkt3442-1.5",
-    [=[
+    "tkt3442-1.4",
+    [[
         SELECT node FROM listhash WHERE id="5000" LIMIT 1;
-    ]=], {
+    ]], {
         -- <tkt3442-1.5>
         1, "no such column: 5000"
         -- </tkt3442-1.5>
diff --git a/test/sql-tap/tkt3493.test.lua b/test/sql-tap/tkt3493.test.lua
index 85f3c089f..31d81d529 100755
--- a/test/sql-tap/tkt3493.test.lua
+++ b/test/sql-tap/tkt3493.test.lua
@@ -246,7 +246,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "tkt3493-3.1",
     [[
-        CREATE TABLE t2(a COLLATE "unicode_ci" PRIMARY KEY, b COLLATE BINARY);
+        CREATE TABLE t2(a  TEXT COLLATE "unicode_ci" PRIMARY KEY, b  TEXT COLLATE BINARY);
         INSERT INTO t2 VALUES('aBc', 'DeF');
     ]], {
         -- <tkt3493-3.1>
diff --git a/test/sql-tap/tkt3508.test.lua b/test/sql-tap/tkt3508.test.lua
index a13e53ef4..2d56c21fe 100755
--- a/test/sql-tap/tkt3508.test.lua
+++ b/test/sql-tap/tkt3508.test.lua
@@ -22,7 +22,7 @@ test:do_catchsql_test(
     "tkt3508-1.1",
     [[
         CREATE TABLE modificationsTmp (
-          id primary key,
+          id  INT primary key,
           SUBSTRATE_HPRD_ID VARCHAR(80),
           SUBSTRATE_GENE_SYMBOL VARCHAR(80),
           SUBSTRATE_ISOFORM_ID VARCHAR(80),
diff --git a/test/sql-tap/tkt3527.test.lua b/test/sql-tap/tkt3527.test.lua
index a7c2070f6..14461dc60 100755
--- a/test/sql-tap/tkt3527.test.lua
+++ b/test/sql-tap/tkt3527.test.lua
@@ -42,9 +42,9 @@ test:do_test(
             CREATE TABLE ElemAnd (
              CodeAnd INTEGER,
              Code INTEGER,
-             Attr1 INTEGER,
-             Attr2 INTEGER,
-             Attr3 INTEGER,
+             Attr1 TEXT,
+             Attr2 TEXT,
+             Attr3 TEXT,
              PRIMARY KEY(CodeAnd,Code)
             );
 
diff --git a/test/sql-tap/tkt3541.test.lua b/test/sql-tap/tkt3541.test.lua
index c1cc5e7c8..00f40faaa 100755
--- a/test/sql-tap/tkt3541.test.lua
+++ b/test/sql-tap/tkt3541.test.lua
@@ -25,7 +25,7 @@ test:do_test(
     "tkt3541-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(x primary key);
+            CREATE TABLE t1(x INT primary key);
             INSERT INTO t1 VALUES(123);
             SELECT CASE ~max(x) WHEN min(x) THEN 1 ELSE max(x) END FROM t1;
         ]]
diff --git a/test/sql-tap/tkt3554.test.lua b/test/sql-tap/tkt3554.test.lua
index 67b6325e4..ed194107f 100755
--- a/test/sql-tap/tkt3554.test.lua
+++ b/test/sql-tap/tkt3554.test.lua
@@ -26,7 +26,7 @@ test:plan(4)
 test:do_execsql_test(
     "tkt3544-1.1",
     [[
-        CREATE TABLE test ( obj, t1, t2, PRIMARY KEY(obj, t1, t2) );
+        CREATE TABLE test ( obj TEXT, t1 INT , t2 INT , PRIMARY KEY(obj, t1, t2) );
 
         CREATE TRIGGER test_insert BEFORE INSERT ON test BEGIN
           UPDATE test SET t1 = new.t1
diff --git a/test/sql-tap/tkt3581.test.lua b/test/sql-tap/tkt3581.test.lua
index b90ac9503..4479b8abb 100755
--- a/test/sql-tap/tkt3581.test.lua
+++ b/test/sql-tap/tkt3581.test.lua
@@ -25,10 +25,10 @@ test:do_test(
     "tkt3581-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
+            CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT, c INT);
             INSERT INTO t1 VALUES(0,544,846);
             INSERT INTO t1 VALUES(1,345,51);
-            CREATE TABLE t2(a INTEGER PRIMARY KEY, b, c);
+            CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT, c INT);
             INSERT INTO t2 SELECT * FROM t1;
             CREATE INDEX i2 on t2(c);
         ]]
diff --git a/test/sql-tap/tkt3731.test.lua b/test/sql-tap/tkt3731.test.lua
index b2701c24c..4f19aa8bb 100755
--- a/test/sql-tap/tkt3731.test.lua
+++ b/test/sql-tap/tkt3731.test.lua
@@ -26,7 +26,7 @@ test:catchsql " pragma recursive_triggers = off "
 test:do_execsql_test(
     "tkt3731-1.1",
     [[
-        CREATE TABLE t1(a PRIMARY KEY, b);
+        CREATE TABLE t1(a  TEXT PRIMARY KEY, b TEXT );
         CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
           INSERT INTO t1 VALUES(new.a || '+', new.b || '+');
         END;
@@ -52,7 +52,7 @@ test:do_execsql_test(
     "tkt3731-1.3",
     [[
         DELETE FROM t1;
-        CREATE TABLE t2(a primary key, b);
+        CREATE TABLE t2(a TEXT primary key, b TEXT);
         INSERT INTO t2 VALUES('e', 'f');
         INSERT INTO t2 VALUES('g', 'h');
         INSERT INTO t1 SELECT * FROM t2;
diff --git a/test/sql-tap/tkt3773.test.lua b/test/sql-tap/tkt3773.test.lua
index 24ab2e7aa..04b991755 100755
--- a/test/sql-tap/tkt3773.test.lua
+++ b/test/sql-tap/tkt3773.test.lua
@@ -27,10 +27,10 @@ test:do_test(
     "tkt3773-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a primary key,b);
+            CREATE TABLE t1(a INT primary key,b INT);
             INSERT INTO t1 VALUES(2,1);
             INSERT INTO t1 VALUES(33,3);
-            CREATE TABLE t2(x,y primary key);
+            CREATE TABLE t2(x INT,y INT primary key);
             INSERT INTO t2 VALUES(123,2);
             INSERT INTO t2 VALUES(4,4);
             SELECT a FROM (
diff --git a/test/sql-tap/tkt3791.test.lua b/test/sql-tap/tkt3791.test.lua
index aca265855..388670a4b 100755
--- a/test/sql-tap/tkt3791.test.lua
+++ b/test/sql-tap/tkt3791.test.lua
@@ -28,7 +28,7 @@ test:do_test(
     "tkt3791-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(x primary key, y DEFAULT(datetime('now')));
+            CREATE TABLE t1(x  INT primary key, y TEXT DEFAULT(datetime('now')));
             INSERT INTO t1(x) VALUES(1);
             SELECT x, length(y) FROM t1;
         ]]
diff --git a/test/sql-tap/tkt3879.test.lua b/test/sql-tap/tkt3879.test.lua
index 8482b974c..55dffe906 100755
--- a/test/sql-tap/tkt3879.test.lua
+++ b/test/sql-tap/tkt3879.test.lua
@@ -22,16 +22,16 @@ test:plan(3)
 test:do_execsql_test(
     "tkt3879.1.1",
     [[
-        CREATE TABLE t1 (a PRIMARY KEY, b);
+        CREATE TABLE t1 (a TEXT PRIMARY KEY, b INT );
         INSERT INTO t1 VALUES ('w',  1);
         INSERT INTO t1 VALUES ('z', -1);
 
-        CREATE TABLE t2 (m INTEGER PRIMARY KEY, n, a, p);
+        CREATE TABLE t2 (m INTEGER PRIMARY KEY, n INT , a TEXT, p INT );
         INSERT INTO t2 VALUES (25, 13, 'w', 1);
         INSERT INTO t2 VALUES (26, 25, 'z', 153);
         INSERT INTO t2 VALUES (27, 25, 'z', 68);
 
-        CREATE TABLE t3 (m PRIMARY KEY);
+        CREATE TABLE t3 (m  INT PRIMARY KEY);
         INSERT INTO t3 VALUES (25);
     ]], {
         -- <tkt3879.1.1>
diff --git a/test/sql-tap/tkt3911.test.lua b/test/sql-tap/tkt3911.test.lua
index 9600c49ef..64c43153a 100755
--- a/test/sql-tap/tkt3911.test.lua
+++ b/test/sql-tap/tkt3911.test.lua
@@ -22,11 +22,11 @@ test:plan(5)
 test:do_execsql_test(
     "tkt3911.1",
     [[
-        CREATE TABLE t1(a primary key,b);
+        CREATE TABLE t1(a INT primary key,b INT);
         INSERT INTO t1 VALUES(1,2);
         INSERT INTO t1 VALUES(11,12);
 
-        CREATE TABLE t2(b primary key,c);
+        CREATE TABLE t2(b INT primary key,c INT);
         INSERT INTO t2 VALUES(2,3);
         INSERT INTO t2 VALUES(22,23);
 
@@ -65,7 +65,7 @@ test:do_test(
     "tkt3911.4",
     function()
         return test:execsql [[
-            CREATE TABLE t3(m,a primary key);
+            CREATE TABLE t3(m TEXT,a INT primary key);
             INSERT INTO t3 VALUES('one',1);
             INSERT INTO t3 VALUES('two',2);
 
diff --git a/test/sql-tap/tkt3935.test.lua b/test/sql-tap/tkt3935.test.lua
index 4e5e677dc..196656442 100755
--- a/test/sql-tap/tkt3935.test.lua
+++ b/test/sql-tap/tkt3935.test.lua
@@ -23,8 +23,8 @@ test:plan(10)
 test:do_execsql_test(
     "tkt3935.1",
     [[
-        CREATE TABLE t1(a primary key, b);
-        CREATE TABLE t2(c primary key, d);
+        CREATE TABLE t1(a INT primary key, b INT);
+        CREATE TABLE t2(c INT primary key, d INT);
     ]], {
         -- <tkt3935.1>
         
diff --git a/test/sql-tap/transitive1.test.lua b/test/sql-tap/transitive1.test.lua
index ed3238f04..178fd9da6 100755
--- a/test/sql-tap/transitive1.test.lua
+++ b/test/sql-tap/transitive1.test.lua
@@ -21,7 +21,7 @@ test:plan(26)
 test:do_execsql_test(
     "transitive1-100",
     [[
-        CREATE TABLE t1(id primary key, a TEXT, b TEXT, c TEXT COLLATE "unicode_ci");
+        CREATE TABLE t1(id  INT primary key, a TEXT, b TEXT, c TEXT COLLATE "unicode_ci");
         INSERT INTO t1 VALUES(1, 'abc','abc','Abc');
         INSERT INTO t1 VALUES(2, 'def','def','def');
         INSERT INTO t1 VALUES(3, 'ghi','ghi','GHI');
@@ -58,10 +58,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "transitive1-200",
     [[
-        CREATE TABLE t2(id primary key, a INTEGER, b INTEGER, c TEXT);
-        INSERT INTO t2 VALUES(1, 100,100,100);
-        INSERT INTO t2 VALUES(2, 20,20,20);
-        INSERT INTO t2 VALUES(3, 3,3,3);
+        CREATE TABLE t2(id  INT primary key, a INTEGER, b INTEGER, c TEXT);
+        INSERT INTO t2 VALUES(1, 100,100,'100');
+        INSERT INTO t2 VALUES(2, 20,20,'20');
+        INSERT INTO t2 VALUES(3, 3,3,'3');
 
         SELECT a,b,c FROM t2 WHERE a=b AND c=b AND c=20;
     ]], {
@@ -73,7 +73,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "transitive1-210",
     [[
-        SELECT a,b,c FROM t2 WHERE a=b AND c=b AND c>=20 ORDER BY +a;
+        SELECT a,b,c FROM t2 WHERE a=b AND c=b AND c>='20' ORDER BY +a;
     ]], {
         -- <transitive1-210>
         3, 3, "3", 20, 20, "20"
@@ -83,7 +83,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "transitive1-220",
     [[
-        SELECT a,b,c FROM t2 WHERE a=b AND c=b AND c<=20 ORDER BY +a;
+        SELECT a,b,c FROM t2 WHERE a=b AND c=b AND c<='20' ORDER BY +a;
     ]], {
         -- <transitive1-220>
         20, 20, "20", 100, 100, "100"
@@ -96,8 +96,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "transitive1-300",
     [[
-        CREATE TABLE t301(w INTEGER PRIMARY KEY, x);
-        CREATE TABLE t302(y INTEGER PRIMARY KEY, z);
+        CREATE TABLE t301(w INTEGER PRIMARY KEY, x INT );
+        CREATE TABLE t302(y INTEGER PRIMARY KEY, z INT );
         INSERT INTO t301 VALUES(1,2),(3,4),(5,6);
         INSERT INTO t302 VALUES(1,3),(3,6),(5,7);
         SELECT *
@@ -209,8 +209,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "transitive1-400",
     [[
-        CREATE TABLE t401(a PRIMARY KEY);
-        CREATE TABLE t402(b PRIMARY KEY);
+        CREATE TABLE t401(a  INT PRIMARY KEY);
+        CREATE TABLE t402(b  INT PRIMARY KEY);
         CREATE TABLE t403(c INTEGER PRIMARY KEY);
         INSERT INTO t401 VALUES(1);
         INSERT INTO t403 VALUES(1);
@@ -229,7 +229,7 @@ test:do_execsql_test(
     "transitive1-410",
     [[
         CREATE TABLE bookmark ( idBookmark integer primary key, idFile integer, timeInSeconds double, totalTimeInSeconds double, thumbNailImage text, player text, playerState text, type integer);
-        CREATE TABLE path ( idPath integer primary key, strPath text, strContent text, strScraper text, strHash text, scanRecursive integer, useFolderNames bool, strSettings text, noUpdate bool, exclude bool, dateAdded text);
+        CREATE TABLE path ( idPath integer primary key, strPath text, strContent text, strScraper text, strHash text, scanRecursive integer, useFolderNames  INT , strSettings text, noUpdate  INT , exclude  INT , dateAdded text);
         INSERT INTO path VALUES(1,'/tmp/tvshows/','tvshows','metadata.tvdb.com','989B1CE5680A14F5F86123F751169B49',0,0,'<settings><setting id="absolutenumber" value="false" /><setting id="dvdorder" value="false" /><setting id="fanart" value="true" /><setting id="language" value="en" /></settings>',0,0,NULL);
         INSERT INTO path VALUES(2,'/tmp/tvshows/The.Big.Bang.Theory/','','','85E1DAAB2F5FF6EAE8AEDF1B5C882D1E',NULL,NULL,NULL,NULL,NULL,'2013-10-23 18:58:43');
         CREATE TABLE files ( idFile integer primary key, idPath integer, strFilename text, playCount integer, lastPlayed text, dateAdded text);
@@ -453,7 +453,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "transitive1-540",
     [[
-        CREATE TABLE b1(x PRIMARY KEY, y);
+        CREATE TABLE b1(x TEXT PRIMARY KEY, y TEXT);
         INSERT INTO b1 VALUES('abc', 'ABC');
         CREATE INDEX b1x ON b1(x);
         SELECT * FROM b1 WHERE (x=y COLLATE "unicode_ci") AND y='ABC';
@@ -466,7 +466,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "transitive1-550",
     [[
-        CREATE TABLE c1(id PRIMARY KEY, x, y COLLATE "unicode_ci", z);
+        CREATE TABLE c1(id  INT PRIMARY KEY, x TEXT, y  TEXT COLLATE "unicode_ci", z TEXT);
         INSERT INTO c1 VALUES(1, 'ABC', 'ABC', 'abc');
         SELECT x, y, z FROM c1 WHERE x=y AND y=z AND z='abc';
     ]], {
diff --git a/test/sql-tap/trigger1.test.lua b/test/sql-tap/trigger1.test.lua
index b595c6b46..7b4fa3df1 100755
--- a/test/sql-tap/trigger1.test.lua
+++ b/test/sql-tap/trigger1.test.lua
@@ -202,7 +202,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "trigger1-1.10",
     [[
-        create table t1(a int PRIMARY KEY,b);
+        create table t1(a int PRIMARY KEY,b TEXT);
         insert into t1 values(1,'a');
         insert into t1 values(2,'b');
         insert into t1 values(3,'c');
@@ -222,7 +222,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "trigger1-1.11",
     [[
-        create table t1(a int PRIMARY KEY,b);
+        create table t1(a int PRIMARY KEY,b TEXT);
         create table tt1(a int PRIMARY KEY);
         insert into t1 values(1,'a');
         insert into t1 values(2,'b');
@@ -245,7 +245,7 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "trigger1-1.12",
     [[
-        create table t1(a int PRIMARY KEY,b);
+        create table t1(a int PRIMARY KEY,b TEXT);
         create trigger t1t instead of update on t1 for each row begin
           delete from t1 WHERE a=old.a+2;
         end;
@@ -459,7 +459,7 @@ test:do_catchsql_test(
 --   }
 -- }
 test:execsql [[
-    CREATE TABLE t2(x int PRIMARY KEY,y);
+    CREATE TABLE t2(x int PRIMARY KEY,y INT);
     DROP VIEW v1;
     DROP TABLE t1;
     INSERT INTO t2 VALUES(3, 4);
@@ -747,7 +747,7 @@ test:do_catchsql_test(
 --   catchsql { INSERT INTO tA VALUES('abc', 2, 3) }
 -- } {1 {datatype mismatch}}
 test:execsql [[
-    CREATE TABLE tA(a INTEGER PRIMARY KEY, b, c);
+    CREATE TABLE tA(a INTEGER PRIMARY KEY, b INT, c INT);
     CREATE TRIGGER tA_trigger BEFORE UPDATE ON tA BEGIN SELECT 1; END;
     INSERT INTO tA VALUES(1, 2, 3);
 ]]
@@ -760,7 +760,7 @@ test:do_test(
     "trigger1-16.1",
     function()
         test:execsql [[
-            CREATE TABLE t16(a int PRIMARY KEY,b,c);
+            CREATE TABLE t16(a int PRIMARY KEY, b INT, c INT);
             CREATE INDEX t16b ON t16(b);
         ]]
         return test:catchsql [[
diff --git a/test/sql-tap/trigger2.test.lua b/test/sql-tap/trigger2.test.lua
index 578acf51a..5d84c312a 100755
--- a/test/sql-tap/trigger2.test.lua
+++ b/test/sql-tap/trigger2.test.lua
@@ -61,10 +61,10 @@ test:plan(26)
 test:catchsql " pragma recursive_triggers = off "
 -- 1.
 ii = 0
-tbl_definitions = { "CREATE TABLE tbl (a INTEGER PRIMARY KEY, b);",
-                    "CREATE TABLE tbl (a PRIMARY KEY, b);",
-                    "CREATE TABLE tbl (a, b PRIMARY KEY);",
-                    "CREATE TABLE tbl (a, b INTEGER PRIMARY KEY);" }
+tbl_definitions = { "CREATE TABLE tbl (a INTEGER PRIMARY KEY, b INT );",
+                    "CREATE TABLE tbl (a  INT PRIMARY KEY, b INT );",
+                    "CREATE TABLE tbl (a INT , b  INT PRIMARY KEY);",
+                    "CREATE TABLE tbl (a INT , b INTEGER PRIMARY KEY);" }
 -- Tarantool: temporary tables are not supported so far. #2119
 -- table.insert(tbl_definitions,"CREATE TEMP TABLE tbl (a, b INTEGER PRIMARY KEY);")
 -- table.insert(tbl_definitions,"CREATE TEMP TABLE tbl (a INTEGER PRIMARY KEY, b);")
@@ -85,8 +85,8 @@ for _, tbl_defn in ipairs(tbl_definitions) do
         INSERT INTO tbl VALUES(3, 4);
     ]]
     test:execsql [[
-        CREATE TABLE rlog (idx INTEGER PRIMARY KEY, old_a, old_b, db_sum_a, db_sum_b, new_a, new_b);
-        CREATE TABLE clog (idx INTEGER PRIMARY KEY, old_a, old_b, db_sum_a, db_sum_b, new_a, new_b);
+        CREATE TABLE rlog (idx INTEGER PRIMARY KEY, old_a INT , old_b INT , db_sum_a INT , db_sum_b INT , new_a INT , new_b INT );
+        CREATE TABLE clog (idx INTEGER PRIMARY KEY, old_a INT , old_b INT , db_sum_a INT , db_sum_b INT , new_a INT , new_b INT );
     ]]
     test:execsql [[
         CREATE TRIGGER before_update_row BEFORE UPDATE ON tbl FOR EACH ROW
@@ -199,7 +199,7 @@ for _, tbl_defn in ipairs(tbl_definitions) do
         "trigger2-1."..ii..".3",
         [[
 
-            CREATE TABLE other_tbl(a PRIMARY KEY, b);
+            CREATE TABLE other_tbl(a  INT PRIMARY KEY, b INT );
             INSERT INTO other_tbl VALUES(1, 2);
             INSERT INTO other_tbl VALUES(3, 4);
             -- INSERT INTO tbl SELECT * FROM other_tbl;
@@ -293,8 +293,8 @@ test:catchsql [[
 --       DROP TABLE log;
 --     }
 --     execsql {
---       CREATE TABLE tbl(a PRIMARY KEY, b, c);
---       CREATE TABLE log(a, b, c);
+--       CREATE TABLE tbl(a  INT PRIMARY KEY, b INT , c INT );
+--       CREATE TABLE log(a INT , b INT , c INT );
 --     }
 --     set query {SELECT * FROM tbl; SELECT * FROM log;}
 --     set prep "$prep; INSERT INTO log VALUES(1, 2, 3);\
@@ -325,8 +325,8 @@ test:catchsql [[
 -- MUST_WORK_TEST
 -- trigger2-3.1: UPDATE OF triggers
 -- execsql {
---   CREATE TABLE tbl (a PRIMARY KEY, b, c, d);
---   CREATE TABLE log (a PRIMARY KEY);
+--   CREATE TABLE tbl (a  INT PRIMARY KEY, b INT , c INT , d INT );
+--   CREATE TABLE log (a  INT PRIMARY KEY);
 --   INSERT INTO log VALUES (0);
 --   INSERT INTO tbl VALUES (0, 0, 0, 0);
 --   INSERT INTO tbl VALUES (1, 0, 0, 0);
@@ -354,8 +354,8 @@ table.insert(when_triggers,"t2 BEFORE INSERT ON tbl WHEN (SELECT count(*) FROM t
 
 
 test:execsql [[
-    CREATE TABLE tbl (a , b PRIMARY KEY, c, d);
-    CREATE TABLE log (a PRIMARY KEY);
+    CREATE TABLE tbl (a  INT , b  INT PRIMARY KEY, c INT , d INT );
+    CREATE TABLE log (a  INT PRIMARY KEY);
     INSERT INTO log VALUES (0);
 ]]
 for _, trig in ipairs(when_triggers) do
@@ -396,9 +396,9 @@ test:execsql [[
 -- integrity_check trigger2-3.3
 -- # Simple cascaded trigger
 test:execsql [[
-    CREATE TABLE tblA(a PRIMARY KEY, b);
-    CREATE TABLE tblB(a PRIMARY KEY, b);
-    CREATE TABLE tblC(a PRIMARY KEY, b);
+    CREATE TABLE tblA(a  INT PRIMARY KEY, b INT );
+    CREATE TABLE tblB(a  INT PRIMARY KEY, b INT );
+    CREATE TABLE tblC(a  INT PRIMARY KEY, b INT );
 
     CREATE TRIGGER tr1 BEFORE INSERT ON tblA BEGIN
       INSERT INTO tblB values(new.a, new.b);
@@ -444,7 +444,7 @@ test:execsql [[
 ]]
 -- Simple recursive trigger
 test:execsql [[
-    CREATE TABLE tbl(a PRIMARY KEY, b, c);
+    CREATE TABLE tbl(a  INT PRIMARY KEY, b INT , c INT );
     CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl
       BEGIN
         INSERT INTO tbl VALUES (new.a + 1, new.b + 1, new.c + 1);
@@ -467,7 +467,7 @@ test:execsql [[
 -- MUST_WORK_TEST
 -- 5.
 -- execsql {
---   CREATE TABLE tbl(a PRIMARY KEY, b, c);
+--   CREATE TABLE tbl(a  INT PRIMARY KEY, b INT , c INT );
 --   CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl
 --     BEGIN
 --       INSERT INTO tbl VALUES (1, 2, 3);
@@ -490,7 +490,7 @@ test:execsql [[
 -- ifcapable conflict {
 --   # Handling of ON CONFLICT by INSERT statements inside triggers
 --   execsql {
---     CREATE TABLE tbl (a primary key, b, c);
+--     CREATE TABLE tbl (a  INT primary key, b INT , c INT );
 --     CREATE TRIGGER ai_tbl AFTER INSERT ON tbl BEGIN
 --       INSERT OR IGNORE INTO tbl values (new.a, 0, 0);
 --     END;
@@ -604,14 +604,14 @@ test:execsql [[
 test:do_execsql_test(
     "trigger2-7.1",
     [[
-        CREATE TABLE ab(a PRIMARY KEY, b);
-        CREATE TABLE cd(c PRIMARY KEY, d);
+        CREATE TABLE ab(a  INT PRIMARY KEY, b INT );
+        CREATE TABLE cd(c  INT PRIMARY KEY, d INT );
         INSERT INTO ab VALUES (1, 2);
         INSERT INTO ab VALUES (0, 0);
         INSERT INTO cd VALUES (3, 4);
 
         CREATE TABLE tlog(ii INTEGER PRIMARY KEY,
-            olda, oldb, oldc, oldd, newa, newb, newc, newd);
+            olda INT , oldb INT , oldc INT , oldd INT , newa INT , newb INT , newc INT , newd INT );
 
         CREATE VIEW abcd AS SELECT a, b, c, d FROM ab, cd;
 
@@ -691,7 +691,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "trigger2-8.1",
     [[
-        CREATE TABLE t1(a PRIMARY KEY,b,c);
+        CREATE TABLE t1(a  INT PRIMARY KEY,b INT ,c INT );
         INSERT INTO t1 VALUES(1,2,3);
         CREATE VIEW v1 AS
           SELECT a+b AS x, b+c AS y, a+c AS z FROM t1;
@@ -705,7 +705,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "trigger2-8.2",
     [[
-        CREATE TABLE v1log(id PRIMARY KEY, a,b,c,d,e,f);
+        CREATE TABLE v1log(id  INT PRIMARY KEY, a INT ,b INT ,c INT ,d INT ,e INT ,f INT );
         CREATE TRIGGER r1 INSTEAD OF DELETE ON v1 BEGIN
           INSERT INTO v1log VALUES(OLD.x, OLD.x,NULL,OLD.y,NULL,OLD.z,NULL);
         END;
diff --git a/test/sql-tap/trigger4.test.lua b/test/sql-tap/trigger4.test.lua
index 32528cfae..f6056617f 100755
--- a/test/sql-tap/trigger4.test.lua
+++ b/test/sql-tap/trigger4.test.lua
@@ -20,8 +20,8 @@ test:plan(1)
 test:do_execsql_test(
     "trigger4-1.1",
     [[
-        create table test1(id integer primary key,a);
-        create table test2(id integer primary key,b);
+        create table test1(id integer primary key,a INT);
+        create table test2(id integer primary key,b INT);
         create view test as
           select test1.id as id,a as a,b as b
           from test1 join test2 on test2.id =  test1.id;
@@ -111,7 +111,7 @@ test:do_execsql_test(
 -- } {1 22 4 5}
 -- do_test trigger4-3.5 {
 --   execsql {
---     create table test2(id,b);
+--     create table test2(id INT, b INT);
 --     insert into test values(7,8,9);
 --     select * from test1;
 --   }
diff --git a/test/sql-tap/trigger7.test.lua b/test/sql-tap/trigger7.test.lua
index f67140cd0..21ff2af4d 100755
--- a/test/sql-tap/trigger7.test.lua
+++ b/test/sql-tap/trigger7.test.lua
@@ -40,7 +40,7 @@ test:do_test(
     "trigger7-2.1",
     function()
         test:execsql [[
-			CREATE TABLE t1(x PRIMARY KEY, y);
+			CREATE TABLE t1(x INT PRIMARY KEY, y INT);
             CREATE TRIGGER r1 AFTER UPDATE OF x ON t1 BEGIN
               SELECT '___update_t1.x___';
             END;
@@ -109,7 +109,7 @@ test:do_test(
 test:do_execsql_test(
     "trigger7-3.1",
     [[
-        CREATE TABLE t2(x PRIMARY KEY,y,z);
+        CREATE TABLE t2(x INT PRIMARY KEY,y INT,z INT);
         CREATE TRIGGER t2r1 AFTER INSERT ON t2 BEGIN SELECT 1; END;
         CREATE TRIGGER t2r2 BEFORE INSERT ON t2 BEGIN SELECT 1; END;
         CREATE TRIGGER t2r3 AFTER UPDATE ON t2 BEGIN SELECT 1; END;
diff --git a/test/sql-tap/trigger8.test.lua b/test/sql-tap/trigger8.test.lua
index abe567119..5c3e77377 100755
--- a/test/sql-tap/trigger8.test.lua
+++ b/test/sql-tap/trigger8.test.lua
@@ -34,8 +34,8 @@ test:do_test(
     "trigger8-1.1",
     function()
         test:execsql [[
-            CREATE TABLE t1(x PRIMARY KEY);
-            CREATE TABLE t2(y PRIMARY KEY);
+            CREATE TABLE t1(x INT PRIMARY KEY);
+            CREATE TABLE t2(y INT PRIMARY KEY);
         ]]
         sql = string.format([[CREATE TRIGGER r%s AFTER INSERT ON t1 BEGIN
 ]], nStatement)
diff --git a/test/sql-tap/trigger9.test.lua b/test/sql-tap/trigger9.test.lua
index 0dfd07ac3..fcefb4d5b 100755
--- a/test/sql-tap/trigger9.test.lua
+++ b/test/sql-tap/trigger9.test.lua
@@ -52,11 +52,11 @@ box.internal.sql_create_function('randstr', 'TEXT', test.randstr, 1)
 test:do_execsql_test(
     "trigger9-1.1",
     [[
-        CREATE TABLE t1(x PRIMARY KEY, y, z);
+        CREATE TABLE t1(x TEXT PRIMARY KEY, y TEXT, z TEXT);
         INSERT INTO t1 VALUES('1', randstr(10000), '2');
         INSERT INTO t1 VALUES('2', randstr(10000), '4');
         INSERT INTO t1 VALUES('3', randstr(10000), '6');
-        CREATE TABLE t2(x PRIMARY KEY);
+        CREATE TABLE t2(x TEXT PRIMARY KEY);
     ]], {
         -- <trigger9-1.1>
 
@@ -281,10 +281,12 @@ test:do_execsql_test(
 test:do_execsql_test(
     "trigger9-3.1",
     [[
-        CREATE TABLE t3(id INTEGER PRIMARY KEY, a, b);
+        CREATE TABLE t3(id INTEGER PRIMARY KEY, a INT, b TEXT);
         INSERT INTO t3 VALUES(1, 1, 'one');
         INSERT INTO t3 VALUES(2, 2, 'two');
         INSERT INTO t3 VALUES(3, 3, 'three');
+        DROP TABLE t2;
+        CREATE TABLE t2(x INT PRIMARY KEY);
     ]], {
         -- <trigger9-3.1>
 
@@ -406,8 +408,8 @@ test:do_execsql_test(
         DROP TABLE t1;
         DROP TABLE t2;
         DROP TABLE t3;
-        CREATE TABLE t1(a PRIMARY KEY, b);
-        CREATE TABLE log(x PRIMARY KEY);
+        CREATE TABLE t1(a INT PRIMARY KEY, b INT);
+        CREATE TABLE log(x TEXT PRIMARY KEY);
         INSERT INTO t1 VALUES(1, 2);
         INSERT INTO t1 VALUES(3, 4);
         CREATE VIEW v1 AS SELECT a, b FROM t1;
diff --git a/test/sql-tap/triggerA.test.lua b/test/sql-tap/triggerA.test.lua
index da1add8e2..d16302453 100755
--- a/test/sql-tap/triggerA.test.lua
+++ b/test/sql-tap/triggerA.test.lua
@@ -134,7 +134,7 @@ test:do_test(
     "triggerA-2.1",
     function()
         return test:execsql [[
-            CREATE TABLE result2(id INTEGER PRIMARY KEY, a,b);
+            CREATE TABLE result2(id INTEGER PRIMARY KEY, a TEXT,b INT);
             CREATE TRIGGER r1d INSTEAD OF DELETE ON v1 BEGIN
               INSERT INTO result2(id, a,b) VALUES((SELECT coalesce(max(id),0) + 1 FROM result2),
                                                   old.y, old.x);
@@ -152,7 +152,7 @@ test:do_test(
     "triggerA-2.2",
     function()
         return test:execsql [[
-            CREATE TABLE result4(id INTEGER PRIMARY KEY, a,b,c,d);
+            CREATE TABLE result4(id INTEGER PRIMARY KEY, a TEXT,b INT,c TEXT,d INT);
             CREATE TRIGGER r1u INSTEAD OF UPDATE ON v1 BEGIN
               INSERT INTO result4(id, a,b,c,d) VALUES((SELECT coalesce(max(id),0) + 1 FROM result4),
                                                       old.y, old.x, new.y, new.x);
@@ -206,7 +206,7 @@ test:do_test(
     "triggerA-2.5",
     function()
         return test:execsql [[
-            CREATE TABLE result1(id INTEGER PRIMARY KEY, a);
+            CREATE TABLE result1(id INTEGER PRIMARY KEY, a TEXT);
             CREATE TRIGGER r3d INSTEAD OF DELETE ON v3 BEGIN
               INSERT INTO result1(id, a) VALUES((SELECT coalesce(max(id),0) + 1 FROM result1),
                                                 old.c1);
@@ -224,7 +224,8 @@ test:do_test(
     "triggerA-2.6",
     function()
         return test:execsql [[
-            DELETE FROM result2;
+            DROP TABLE result2;
+            CREATE TABLE result2(id INTEGER PRIMARY KEY, a TEXT,b TEXT);
             CREATE TRIGGER r3u INSTEAD OF UPDATE ON v3 BEGIN
               INSERT INTO result2(id, a,b) VALUES((SELECT coalesce(max(id),0) + 1 FROM result2),
                                                   old.c1, new.c1);
@@ -278,7 +279,8 @@ test:do_test(
     "triggerA-2.9",
     function()
         return test:execsql [[
-            DELETE FROM result2;
+            DROP TABLE result2;
+            CREATE TABLE result2(id INTEGER PRIMARY KEY, a TEXT,b INT);
             CREATE TRIGGER r5d INSTEAD OF DELETE ON v5 BEGIN
               INSERT INTO result2(id, a,b) VALUES((SELECT coalesce(max(id),0) + 1 FROM result2),
                                                   old.x, old.b);
@@ -288,7 +290,7 @@ test:do_test(
         ]]
     end, {
         -- <triggerA-2.9>
-        5, 504
+        "5", 504
         -- </triggerA-2.9>
     })
 
@@ -306,7 +308,7 @@ test:do_test(
         ]]
     end, {
         -- <triggerA-2.10>
-        3, 305, 3, 9900305, 4, 404, 4, 9900404, 5, 504, 5, 9900504
+        "3", 305, "3", 9900305, "4", 404, "4", 9900404, "5", 504, "5", 9900504
         -- </triggerA-2.10>
     })
 
@@ -320,7 +322,7 @@ test:do_test(
         ]]
     end, {
         -- <triggerA-2.11>
-        3, 305, 3, 9900305, 4, 404, 4, 9900404, 5, 504, 5, 9900504
+        "3", 305, "3", 9900305, "4", 404, "4", 9900404, "5", 504, "5", 9900504
         -- </triggerA-2.11>
     })
 
diff --git a/test/sql-tap/triggerB.test.lua b/test/sql-tap/triggerB.test.lua
index df7e2c350..00474a499 100755
--- a/test/sql-tap/triggerB.test.lua
+++ b/test/sql-tap/triggerB.test.lua
@@ -81,9 +81,9 @@ test:do_test(
     "triggerB-2.3",
     function()
         test:execsql [[
-            CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
+            CREATE TABLE t2(a INTEGER PRIMARY KEY, b INT );
             INSERT INTO t2 VALUES(1,2);
-            CREATE TABLE changes(x PRIMARY KEY,y);
+            CREATE TABLE changes(x  INT PRIMARY KEY,y INT );
             CREATE TRIGGER r1t2 AFTER UPDATE ON t2 BEGIN
               INSERT INTO changes VALUES(new.a, new.b);
             END;
@@ -128,15 +128,15 @@ test:do_test(
     function()
         test:execsql [[
             CREATE TABLE t3(
-               c0 PRIMARY KEY,  c1,  c2,  c3,  c4,  c5,  c6,  c7,  c8,  c9,
-               c10, c11, c12, c13, c14, c15, c16, c17, c18, c19,
-               c20, c21, c22, c23, c24, c25, c26, c27, c28, c29,
-               c30, c31, c32, c33, c34, c35, c36, c37, c38, c39,
-               c40, c41, c42, c43, c44, c45, c46, c47, c48, c49,
-               c50, c51, c52, c53, c54, c55, c56, c57, c58, c59,
-               c60, c61, c62, c63, c64, c65
+               c0  TEXT PRIMARY KEY,  c1 TEXT ,  c2 TEXT ,  c3 TEXT ,  c4 TEXT ,  c5 TEXT ,  c6 TEXT ,  c7 TEXT ,  c8 TEXT ,  c9 TEXT ,
+               c10 TEXT , c11 TEXT , c12 TEXT , c13 TEXT , c14 TEXT , c15 TEXT , c16 TEXT , c17 TEXT , c18 TEXT , c19 TEXT ,
+               c20 TEXT , c21 TEXT , c22 TEXT , c23 TEXT , c24 TEXT , c25 TEXT , c26 TEXT , c27 TEXT , c28 TEXT , c29 TEXT ,
+               c30 TEXT , c31 TEXT , c32 TEXT , c33 TEXT , c34 TEXT , c35 TEXT , c36 TEXT , c37 TEXT , c38 TEXT , c39 TEXT ,
+               c40 TEXT , c41 TEXT , c42 TEXT , c43 TEXT , c44 TEXT , c45 TEXT , c46 TEXT , c47 TEXT , c48 TEXT , c49 TEXT ,
+               c50 TEXT , c51 TEXT , c52 TEXT , c53 TEXT , c54 TEXT , c55 TEXT , c56 TEXT , c57 TEXT , c58 TEXT , c59 TEXT ,
+               c60 TEXT , c61 TEXT , c62 TEXT , c63 TEXT , c64 TEXT , c65 TEXT 
             );
-            CREATE TABLE t3_changes(colnum PRIMARY KEY, oldval, newval);
+            CREATE TABLE t3_changes(colnum INT PRIMARY KEY, oldval TEXT , newval TEXT );
             INSERT INTO t3 VALUES(
                'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9',
                'a10','a11','a12','a13','a14','a15','a16','a17','a18','a19',
diff --git a/test/sql-tap/triggerC.test.lua b/test/sql-tap/triggerC.test.lua
index 42639edc9..2303b5ca6 100755
--- a/test/sql-tap/triggerC.test.lua
+++ b/test/sql-tap/triggerC.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(59)
+test:plan(48)
 
 --!./tcltestrunner.lua
 -- 2009 August 24
@@ -52,8 +52,8 @@ test:execsql " PRAGMA recursive_triggers = on "
 test:do_execsql_test(
     "triggerC-1.1",
     [[
-        CREATE TABLE t1(a PRIMARY KEY, b, c);
-        CREATE TABLE log(t PRIMARY KEY, a1, b1, c1, a2, b2, c2);
+        CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c TEXT);
+        CREATE TABLE log(t TEXT PRIMARY KEY, a1 TEXT, b1 TEXT, c1 TEXT, a2 TEXT, b2 TEXT, c2 TEXT);
         CREATE TRIGGER trig1 BEFORE INSERT ON t1 BEGIN
           INSERT INTO log VALUES('before', NULL, NULL, NULL, new.a, new.b, new.c);
         END;
@@ -148,7 +148,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "triggerC-1.8",
     [[
-        CREATE TABLE t4(a PRIMARY KEY, b);
+        CREATE TABLE t4(a INT PRIMARY KEY, b INT);
         CREATE TRIGGER t4t AFTER DELETE ON t4 BEGIN
           SELECT RAISE(ABORT, 'delete is not supported');
         END;
@@ -182,7 +182,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "triggerC-1.11",
     [[
-        CREATE TABLE t5 (a primary key, b, c);
+        CREATE TABLE t5 (a INT primary key, b INT, c INT);
         INSERT INTO t5 values (1, 2, 3);
         CREATE TRIGGER au_tbl AFTER UPDATE ON t5 BEGIN
           UPDATE OR IGNORE t5 SET a = new.a, c = 10;
@@ -206,7 +206,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "triggerC-1.13",
     [[
-        CREATE TABLE t6(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t6(a INTEGER PRIMARY KEY, b INT);
         INSERT INTO t6 VALUES(1, 2);
         create trigger r1 after update on t6 for each row begin
           SELECT 1;
@@ -222,9 +222,9 @@ test:do_execsql_test(
     "triggerC-1.14",
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE cnt(n PRIMARY KEY);
+        CREATE TABLE cnt(n INT PRIMARY KEY);
         INSERT INTO cnt VALUES(0);
-        CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE, c, d, e);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT UNIQUE, c INT, d INT, e INT);
         CREATE INDEX t1cd ON t1(c,d);
         CREATE TRIGGER t1r1 AFTER UPDATE ON t1 BEGIN UPDATE cnt SET n=n+1; END;
         INSERT INTO t1 VALUES(1,2,3,4,5);
@@ -253,7 +253,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "triggerC-2.1.0",
     [[
-        CREATE TABLE t2(a PRIMARY KEY);
+        CREATE TABLE t2(a INT PRIMARY KEY);
     ]], {
         -- <triggerC-2.1.0>
 
@@ -361,7 +361,7 @@ end
 test:do_execsql_test(
     "triggerC-3.1.1",
     [[
-        CREATE TABLE t3(a PRIMARY KEY, b);
+        CREATE TABLE t3(a INT PRIMARY KEY, b INT);
         CREATE TRIGGER t3i AFTER INSERT ON t3 BEGIN
           DELETE FROM t3 WHERE a = new.a;
         END;
@@ -397,7 +397,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "triggerC-3.2.1",
     [[
-        CREATE TABLE t3b(x PRIMARY KEY);
+        CREATE TABLE t3b(x INT PRIMARY KEY);
         CREATE TRIGGER t3bi AFTER INSERT ON t3b BEGIN INSERT INTO t3b VALUES(new.x+1); END;
     ]], {
         -- <triggerC-3.2.1>
@@ -423,180 +423,7 @@ test:do_execsql_test(
         -- </triggerC-3.2.3>
     })
 
--------------------------------------------------------------------------
--- This next block of tests, triggerC-4.*, checks that affinity
--- transformations and constraint processing is performed at the correct
--- times relative to BEFORE and AFTER triggers.
---
--- For an INSERT statement, for each row to be inserted:
---
---   1. Apply affinities to non-rowid values to be inserted.
---   2. Fire BEFORE triggers.
---   3. Process constraints.
---   4. Insert new record.
---   5. Fire AFTER triggers.
---
--- If the value of the rowid field is to be automatically assigned, it is
--- set to -1 in the new.* record. Even if it is explicitly set to NULL
--- by the INSERT statement.
---
--- For an UPDATE statement, for each row to be deleted:
---
---   1. Apply affinities to non-rowid values to be inserted.
---   2. Fire BEFORE triggers.
---   3. Process constraints.
---   4. Insert new record.
---   5. Fire AFTER triggers.
---
--- For a DELETE statement, for each row to be deleted:
---
---   1. Fire BEFORE triggers.
---   2. Remove database record.
---   3. Fire AFTER triggers.
---
--- When a numeric value that as an exact integer representation is stored
--- in a column with REAL affinity, it is actually stored as an integer.
--- These tests check that the typeof() such values is always 'real',
--- not 'integer'.
---
--- triggerC-4.1.*: Check that affinity transformations are made before
---                 triggers are invoked.
---
-test:do_test(
-    "triggerC-4.1.1",
-    function()
-        test:catchsql " DROP TABLE log "
-        test:catchsql " DROP TABLE t4 "
-        return test:execsql [[
-            CREATE TABLE log(id PRIMARY KEY, t);
-            CREATE TABLE t4(a TEXT PRIMARY KEY,b INTEGER,c REAL);
-            CREATE TRIGGER t4bi BEFORE INSERT ON t4 BEGIN
-              INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
-                                     new.a     || ' ' || typeof(new.a)     || ' ' ||
-                                     new.b     || ' ' || typeof(new.b)     || ' ' ||
-                                     new.c     || ' ' || typeof(new.c)
-              );
-            END;
-            CREATE TRIGGER t4ai AFTER INSERT ON t4 BEGIN
-              INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
-                                     new.a     || ' ' || typeof(new.a)     || ' ' ||
-                                     new.b     || ' ' || typeof(new.b)     || ' ' ||
-                                     new.c     || ' ' || typeof(new.c)
-              );
-            END;
-            CREATE TRIGGER t4bd BEFORE DELETE ON t4 BEGIN
-              INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
-                                     old.a     || ' ' || typeof(old.a)     || ' ' ||
-                                     old.b     || ' ' || typeof(old.b)     || ' ' ||
-                                     old.c     || ' ' || typeof(old.c)
-              );
-            END;
-            CREATE TRIGGER t4ad AFTER DELETE ON t4 BEGIN
-              INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
-                                     old.a     || ' ' || typeof(old.a)     || ' ' ||
-                                     old.b     || ' ' || typeof(old.b)     || ' ' ||
-                                     old.c     || ' ' || typeof(old.c)
-              );
-            END;
-            CREATE TRIGGER t4bu BEFORE UPDATE ON t4 BEGIN
-              INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
-                                     old.a     || ' ' || typeof(old.a)     || ' ' ||
-                                     old.b     || ' ' || typeof(old.b)     || ' ' ||
-                                     old.c     || ' ' || typeof(old.c)
-              );
-              INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
-                                     new.a     || ' ' || typeof(new.a)     || ' ' ||
-                                     new.b     || ' ' || typeof(new.b)     || ' ' ||
-                                     new.c     || ' ' || typeof(new.c)
-              );
-            END;
-            CREATE TRIGGER t4au AFTER UPDATE ON t4 BEGIN
-              INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
-                                     old.a     || ' ' || typeof(old.a)     || ' ' ||
-                                     old.b     || ' ' || typeof(old.b)     || ' ' ||
-                                     old.c     || ' ' || typeof(old.c)
-              );
-              INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
-                                     new.a     || ' ' || typeof(new.a)     || ' ' ||
-                                     new.b     || ' ' || typeof(new.b)     || ' ' ||
-                                     new.c     || ' ' || typeof(new.c)
-              );
-            END;
-        ]]
-    end, {
-        -- <triggerC-4.1.1>
-
-        -- </triggerC-4.1.1>
-    })
-
-local
-tests4 = {{ [[INSERT INTO t4 VALUES('1', '1', '1');
-              DELETE FROM t4;]], {
-                 "1 text 1 integer 1.0 real",
-                 "1 text 1 integer 1.0 real",
-                 "1 text 1 integer 1.0 real",
-                 "1 text 1 integer 1.0 real"}},
-
-          { [[INSERT INTO t4(a,b,c) VALUES(45, 45, 45);
-              DELETE FROM t4;]], {
-                  "45 text 45 integer 45.0 real",
-                  "45 text 45 integer 45.0 real",
-                  "45 text 45 integer 45.0 real",
-                  "45 text 45 integer 45.0 real"}},
-
-          { [[INSERT INTO t4(a,b,c) VALUES(-42.0, -42.0, -42.0);
-              DELETE FROM t4;]], {
-                  "-42.0 text -42 integer -42.0 real",
-                  "-42.0 text -42 integer -42.0 real",
-                  "-42.0 text -42 integer -42.0 real",
-                  "-42.0 text -42 integer -42.0 real"}},
-
-          { [[INSERT INTO t4(a,b,c) VALUES(-42.4, -42.4, -42.4);
-              DELETE FROM t4;]], {
-                  "-42.4 text -42.4 real -42.4 real",
-                  "-42.4 text -42.4 real -42.4 real",
-                  "-42.4 text -42.4 real -42.4 real",
-                  "-42.4 text -42.4 real -42.4 real"}},
-
-          { [[INSERT INTO t4 VALUES(7, 7, 7);
-              UPDATE t4 SET a=8, b=8, c=8;]], {
-                  "7 text 7 integer 7.0 real",
-                  "7 text 7 integer 7.0 real",
-                  "7 text 7 integer 7.0 real",
-                  "8 text 8 integer 8.0 real",
-                  "7 text 7 integer 7.0 real",
-                  "8 text 8 integer 8.0 real"}},
-
-          { [[UPDATE t4 SET a=8;]], {
-                  "8 text 8 integer 8.0 real",
-                  "8 text 8 integer 8.0 real",
-                  "8 text 8 integer 8.0 real",
-                  "8 text 8 integer 8.0 real"}},
-
-          { [[UPDATE t4 SET a='9', b='9', c='9';]], {
-                  "8 text 8 integer 8.0 real",
-                  "9 text 9 integer 9.0 real",
-                  "8 text 8 integer 8.0 real",
-                  "9 text 9 integer 9.0 real"}},
-
-          { [[UPDATE t4 SET a='9.1', b='9.1', c='9.1';]], {
-                  "9 text 9 integer 9.0 real",
-                  "9.1 text 9.1 real 9.1 real",
-                  "9 text 9 integer 9.0 real",
-                  "9.1 text 9.1 real 9.1 real"}}}
-
-              -- MUST_WORK_TEST
--- for _ in X(0, "X!foreach", [=[["n insert log","\n\n  2 {\n   INSERT INTO t4 VALUES('1', '1', '1');\n   DELETE FROM t4;\n  } {\n     1 integer 1 text 1 integer 1.0 real\n     1 integer 1 text 1 integer 1.0 real\n     1 integer 1 text 1 integer 1.0 real\n  }\n\n  3 {\n   INSERT INTO t4(a,b,c) VALUES(45, 45, 45);\n   DELETE FROM t4;\n  } {\n    45 integer 45 text 45 integer 45.0 real\n    45 integer 45 text 45 integer 45.0 real\n    45 integer 45 text 45 integer 45.0 real\n  }\n\n  4 {\n   INSERT INTO t4(a,b,c) VALUES(-42.0, -42.0, -42.0);\n   DELETE FROM t4;\n  } {\n    -42 integer -42.0 text -42 integer -42.0 real\n    -42 integer -42.0 text -42 integer -42.0 real\n    -42 integer -42.0 text -42 integer -42.0 real\n  }\n\n  5 {\n   INSERT INTO t4(a,b,c) VALUES(-42.4, -42.4, -42.4);\n   DELETE FROM t4;\n  } {\n     1 integer -42.4 text -42.4 real -42.4 real\n     1 integer -42.4 text -42.4 real -42.4 real\n     1 integer -42.4 text -42.4 real -42.4 real\n  }\n\n  6 {\n   INSERT INTO t4 VALUES(7, 7, 7);\n   UPDATE t4 SET a=8, b=8, c=8;\n  } {\n    -1 integer 7 text 7 integer 7.0 real\n     1 integer 7 text 7 integer 7.0 real\n     1 integer 7 text 7 integer 7.0 real\n     1 integer 8 text 8 integer 8.0 real\n     1 integer 7 text 7 integer 7.0 real\n     1 integer 8 text 8 integer 8.0 real\n  }\n\n  8 {\n   UPDATE t4 SET a='9', b='9', c='9';\n  } {\n     2 integer 9 text 9 integer 9.0 real\n     2 integer 8 text 8 integer 8.0 real\n     2 integer 9 text 9 integer 9.0 real\n  }\n\n  9 {\n   UPDATE t4 SET a='9.1', b='9.1', c='9.1';\n  } {\n     2 integer 9.1 text 9.1 real    9.1 real\n     2 integer 9   text 9   integer 9.0 real\n     2 integer 9.1 text 9.1 real    9.1 real\n  }\n"]]=]) do
-
-for n, v in ipairs(tests4) do
-    test:do_execsql_test(
-        "triggerC-4.1."..(n+1),
-        string.format([[ DELETE FROM log;
-                         %s ;
-                         SELECT t FROM log ORDER BY id;]], v[1]),
-        v[2])
-end
----------------------------------------------------------------------------
+--------------------------------------------------------------------------
 -- This block of tests, triggerC-5.*, test that DELETE triggers are fired
 -- if a row is deleted as a result of OR REPLACE conflict resolution.
 --
@@ -604,13 +431,13 @@ test:do_execsql_test(
     "triggerC-5.1.0",
     [[
         DROP TABLE IF EXISTS t5;
-        CREATE TABLE t5(a INTEGER PRIMARY KEY, b);
+        CREATE TABLE t5(a INTEGER PRIMARY KEY, b TEXT);
         CREATE UNIQUE INDEX t5i ON t5(b);
         INSERT INTO t5 VALUES(1, 'a');
         INSERT INTO t5 VALUES(2, 'b');
         INSERT INTO t5 VALUES(3, 'c');
 
-        CREATE TABLE t5g(a PRIMARY KEY, b, c);
+        CREATE TABLE t5g(a INT PRIMARY KEY, b TEXT, c INT);
         CREATE TRIGGER t5t BEFORE DELETE ON t5 BEGIN
           INSERT INTO t5g VALUES(old.a, old.b, (SELECT count(*) FROM t5));
         END;
@@ -885,7 +712,7 @@ test:do_test(
     "triggerC-10.1",
     function()
         test:execsql [[
-            CREATE TABLE t10(a PRIMARY KEY, updatecnt DEFAULT 0);
+            CREATE TABLE t10(a TEXT PRIMARY KEY, updatecnt INT DEFAULT 0);
             CREATE TRIGGER t10_bu BEFORE UPDATE OF a ON t10 BEGIN
               UPDATE t10 SET updatecnt = updatecnt+1 WHERE a = old.a;
             END;
@@ -921,10 +748,10 @@ test:do_test(
     function()
         test:execsql [[
             CREATE TABLE t11(
-              c1 PRIMARY KEY,   c2,  c3,  c4,  c5,  c6,  c7,  c8,  c9, c10,
-              c11, c12, c13, c14, c15, c16, c17, c18, c19, c20,
-              c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
-              c31, c32, c33, c34, c35, c36, c37, c38, c39, c40
+              c1 INT PRIMARY KEY,   c2 INT,  c3 INT,  c4 INT,  c5 INT,  c6 INT,  c7 INT,  c8 INT,  c9 INT, c10 INT,
+              c11 INT, c12 INT, c13 INT, c14 INT, c15 INT, c16 INT, c17 INT, c18 INT, c19 INT, c20 INT,
+              c21 INT, c22 INT, c23 INT, c24 INT, c25 INT, c26 INT, c27 INT, c28 INT, c29 INT, c30 INT,
+              c31 INT, c32 INT, c33 INT, c34 INT, c35 INT, c36 INT, c37 INT, c38 INT, c39 INT, c40 INT
             );
 
             CREATE TRIGGER t11_bu BEFORE UPDATE OF c1 ON t11 BEGIN
@@ -960,7 +787,7 @@ test:do_test(
     "triggerC-11.0",
     function()
         test:catchsql " DROP TABLE IF EXISTS log "
-        return test:execsql " CREATE TABLE log(id INTEGER PRIMARY KEY, a, b) "
+        return test:execsql " CREATE TABLE log(id INTEGER PRIMARY KEY, a INT, b TEXT) "
     end, {
         -- <triggerC-11.0>
 
@@ -970,8 +797,7 @@ test:do_test(
 -- MUST_WORK_TEST
 local
 tests11 = {-- {"CREATE TABLE t1(a PRIMARY KEY, b)",                         {{}, {}}},
-           {"CREATE TABLE t1(a PRIMARY KEY DEFAULT 1, b DEFAULT 'abc')", {1, "abc"}},
-           {"CREATE TABLE t1(a, b PRIMARY KEY DEFAULT 4.5)",             {"", 4.5}}}
+           {"CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 1, b TEXT DEFAULT 'abc')", {1, "abc"}}}
 
 --for _ in X(0, "X!foreach", [=[["testno tbl defaults","\n  1 \"CREATE TABLE t1(a PRIMARY KEY, b)\"                          {{} {}}\n  2 \"CREATE TABLE t1(a PRIMARY KEY DEFAULT 1, b DEFAULT 'abc')\"  {1 abc}\n  3 \"CREATE TABLE t1(a PRIMARY KEY, b DEFAULT 4.5)\"              {{} 4.5}\n"]]=]) do
 for testno, v in ipairs(tests11) do
@@ -1030,7 +856,7 @@ test:do_test(
         test:catchsql " DROP TABLE t2 "
         return test:execsql [[
             DELETE FROM log;
-            CREATE TABLE t2(a PRIMARY KEY, b);
+            CREATE TABLE t2(a INT PRIMARY KEY, b INT);
             CREATE VIEW v2 AS SELECT * FROM t2;
             CREATE TRIGGER tv2 INSTEAD OF INSERT ON v2 BEGIN
               INSERT INTO log VALUES((SELECT coalesce(max(id),0) + 1 FROM log),
@@ -1052,7 +878,7 @@ test:do_test(
 test:execsql(
     [[
     DROP TABLE t1;
-    CREATE TABLE t1(id INTEGER PRIMARY KEY, a, b);
+    CREATE TABLE t1(id INTEGER PRIMARY KEY, a INT, b INT);
     INSERT INTO t1 VALUES(1, 1, 2);
     INSERT INTO t1 VALUES(2, 3, 4);
     INSERT INTO t1 VALUES(3, 5, 6);
@@ -1062,7 +888,7 @@ test:do_execsql_test(
     "triggerC-13.1",
     [[
         PRAGMA recursive_triggers = 'ON';
-        CREATE TABLE t12(id INTEGER PRIMARY KEY, a, b);
+        CREATE TABLE t12(id INTEGER PRIMARY KEY, a INT, b INT);
         INSERT INTO t12 VALUES(1, 1, 2);
         CREATE TRIGGER tr12 AFTER UPDATE ON t12 BEGIN
           UPDATE t12 SET a=new.a+1, b=new.b+1;
@@ -1100,21 +926,21 @@ SQL = [[
   DROP TABLE IF EXISTS t2;
   DROP TABLE IF EXISTS t4;
   DROP TABLE IF EXISTS t5;
-  CREATE TABLE t1(a PRIMARY KEY, b, c);
+  CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT);
   CREATE INDEX i1 ON t1(a, c);
   CREATE INDEX i2 ON t1(b, c);
   INSERT INTO t1 VALUES(1, 2, 3);
 
-  CREATE TABLE t2(e PRIMARY KEY, f);
+  CREATE TABLE t2(e INT PRIMARY KEY, f INT);
   CREATE INDEX i3 ON t2(e);
   INSERT INTO t2 VALUES(1234567, 3);
 
-  CREATE TABLE empty(x PRIMARY KEY);
-  CREATE TABLE not_empty(x PRIMARY KEY);
+  CREATE TABLE empty(x INT PRIMARY KEY);
+  CREATE TABLE not_empty(x INT PRIMARY KEY);
   INSERT INTO not_empty VALUES(2);
 
-  CREATE TABLE t4(x PRIMARY KEY);
-  CREATE TABLE t5(g PRIMARY KEY, h, i);
+  CREATE TABLE t4(x INT PRIMARY KEY);
+  CREATE TABLE t5(g INT PRIMARY KEY, h INT, i INT);
 
   CREATE TRIGGER trig BEFORE INSERT ON t4 BEGIN
     INSERT INTO t5 SELECT * FROM t1 WHERE
@@ -1147,10 +973,10 @@ test:do_execsql_test(
     [[
         PRAGMA recursive_triggers = 1;
         CREATE TABLE node(
-            id not null primary key,
-            pid int not null default 0,
-            key varchar not null,
-            path varchar default '',
+            id int not null primary key,
+            pid int not null default 0 references node,
+            key TEXT not null,
+            path TEXT default '',
             unique(pid, key)
             );
         CREATE TRIGGER node_delete_referencing AFTER DELETE ON node
diff --git a/test/sql-tap/triggerD.test.lua b/test/sql-tap/triggerD.test.lua
index ea2980394..f4d1c29a8 100755
--- a/test/sql-tap/triggerD.test.lua
+++ b/test/sql-tap/triggerD.test.lua
@@ -36,8 +36,8 @@ test:do_test(
     "triggerD-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(rowid PRIMARY KEY, oid, _rowid_, x);
-            CREATE TABLE log(a PRIMARY KEY,b,c,d,e);
+            CREATE TABLE t1(rowid INT PRIMARY KEY, oid INT, _rowid_ INT, x INT);
+            CREATE TABLE log(a TEXT PRIMARY KEY,b INT,c INT,d INT,e INT);
             CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
               INSERT INTO log VALUES('r1', new.rowid, new.oid, new._rowid_, new.x);
             END;
@@ -112,7 +112,7 @@ test:do_test(
 -- do_test triggerD-2.1 {
 --   db eval {
 --     DROP TABLE t1;
---     CREATE TABLE t1(w PRIMARY KEY,x,y,z);
+--     CREATE TABLE t1(w INT PRIMARY KEY,x INT,y INT,z INT);
 --     CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
 --       INSERT INTO log VALUES('r1', new.rowid, new.oid, new._rowid_, new.x);
 --     END;
@@ -165,9 +165,9 @@ test:do_test(
 -- # and a main database trigge is created on the main table, the trigger
 -- # is incorrectly bound to the TEMP table. For example:
 -- #
--- #   CREATE TABLE t1(x);
+-- #   CREATE TABLE t1(x INT);
 -- #   CREATE TEMP TABLE t1(x);
--- #   CREATE TABLE t2(z);
+-- #   CREATE TABLE t2(z INT);
 -- #   CREATE TRIGGER main.r1 AFTER INSERT ON t1 BEGIN
 -- #     INSERT INTO t2 VALUES(10000 + new.x);
 -- #   END;
@@ -180,9 +180,9 @@ test:do_test(
 -- #
 -- do_test triggerD-3.1 {
 --   db eval {
---     CREATE TABLE t300(x);
+--     CREATE TABLE t300(x INT );
 --     CREATE TEMP TABLE t300(x);
---     CREATE TABLE t301(y);
+--     CREATE TABLE t301(y INT );
 --     CREATE TRIGGER main.r300 AFTER INSERT ON t300 BEGIN
 --       INSERT INTO t301 VALUES(10000 + new.x);
 --     END;
@@ -221,10 +221,10 @@ test:do_test(
 --   forcedelete test.db test2.db
 --   sqlite3 db test.db
 --   db eval {
---     CREATE TABLE t1(x);
+--     CREATE TABLE t1(x INT);
 --     ATTACH 'test2.db' AS db2;
---     CREATE TABLE db2.t2(y);
---     CREATE TABLE db2.log(z);
+--     CREATE TABLE db2.t2(y INT);
+--     CREATE TABLE db2.log(z INT);
 --     CREATE TRIGGER db2.trig AFTER INSERT ON db2.t2 BEGIN
 --       INSERT INTO log(z) VALUES(new.y);
 --     END;
diff --git a/test/sql-tap/types.test.lua b/test/sql-tap/types.test.lua
index 1da251293..09c16f2e9 100755
--- a/test/sql-tap/types.test.lua
+++ b/test/sql-tap/types.test.lua
@@ -1,7 +1,7 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
 NULL = require('msgpack').NULL
-test:plan(51)
+test:plan(14)
 
 --!./tcltestrunner.lua
 -- 2001 September 15
@@ -39,99 +39,6 @@ test:plan(51)
 -- types-2.5.*: Records with a few different storage classes.
 --
 -- types-3.*: Test that the '=' operator respects manifest types.
---
--- Disable encryption on the database for this test.
---db("close")
---DB = X(44, "X!expr", [=[[["sqlite3","db","test.db"],["sqlite3_connection_pointer","db"]]]=])
---sqlite3_rekey $DB {}
--- Create a table with one column for each type of affinity
-test:do_execsql_test(
-    "types-1.1.0",
-    [[
-        CREATE TABLE t1(id primary key, i integer, n numeric, t text, o blob);
-    ]], {
-        -- <types-1.1.0>
-        
-        -- </types-1.1.0>
-    })
-
--- Each element of the following list represents one test case.
---
--- The first value of each sub-list is an SQL literal. The following
--- four value are the storage classes that would be used if the
--- literal were inserted into a column with affinity INTEGER, NUMERIC, TEXT
--- or NONE, respectively.
-local values = {
-      {1, '5.0', {"integer", "integer", "text", "real"}},
-      {2, '5.1', {"real", "real", "text", "real"}},
-      {3, '5', {"integer", "integer", "text", "integer"}},
-      {4, "'5.0'", {"integer", "integer", "text", "text"}},
-      {5, "'5.1'", {"real", "real", "text", "text"}},
-      {6, "'-5.0'", {"integer", "integer", "text", "text"}},
-      {7, "'-5.0'", {"integer", "integer", "text", "text"}},
-      {8, "'5'", {"integer", "integer", "text", "text"}},
-      {9, "'abc'", {"text", "text", "text", "text"}},
-      {10, 'NULL', {"null", "null", "null", "null"}},
-      {11, "X'00'",  {"blob", "blob", "blob", "blob"}},
-}
-
-
--- This code tests that the storage classes specified above (in the $values
--- table) are correctly assigned when values are inserted using a statement
--- of the form:
---
--- INSERT INTO <table> VALUE(<values>);
-
-for _, val in ipairs(values) do
-    local tnum = val[1]
-    local lit = test.lindex(val, 1)
-    test:execsql "DELETE FROM t1;"
-    test:execsql(string.format("INSERT INTO t1 VALUES(1, %s, %s, %s, %s);", lit, lit, lit, lit))
-    test:do_execsql_test(
-        "types-1.1."..tnum,
-        [[
-            SELECT typeof(i), typeof(n), typeof(t), typeof(o) FROM t1;
-        ]], val[3])
-end
--- This code tests that the storage classes specified above (in the $values
--- table) are correctly assigned when values are inserted using a statement
--- of the form:
---
--- INSERT INTO t1 SELECT ....
---
-for _, val in ipairs(values) do
-    local tnum = val[1]
-    local lit = test.lindex(val, 1)
-    test:execsql "DELETE FROM t1;"
-    test:execsql(string.format("INSERT INTO t1 SELECT 1, %s, %s, %s, %s;", lit, lit, lit, lit))
-    test:do_execsql_test(
-        "types-1.2."..tnum,
-        [[
-            SELECT typeof(i), typeof(n), typeof(t), typeof(o) FROM t1;
-        ]], val[3])
-
-end
--- This code tests that the storage classes specified above (in the $values
--- table) are correctly assigned when values are inserted using a statement
--- of the form:
---
--- UPDATE <table> SET <column> = <value>;
---
-for _, val in ipairs(values) do
-    local tnum = val[1]
-    local lit = test.lindex(val, 1)
-    test:execsql(string.format("UPDATE t1 SET id = 1, i = %s, n = %s, t = %s, o = %s;", lit, lit, lit, lit))
-    test:do_execsql_test(
-        "types-1.3."..tnum,
-        [[
-            SELECT typeof(i), typeof(n), typeof(t), typeof(o) FROM t1;
-        ]], val[3])
-
-    tnum = tnum + 1
-end
-test:execsql [[
-    DROP TABLE t1;
-]]
 ---- Open the table with root-page $rootpage at the btree
 ---- level. Return a list that is the length of each record
 ---- in the table, in the tables default scanning order.
@@ -158,7 +65,7 @@ test:execsql [[
 test:do_execsql_test(
     "types-2.1.1",
     [[
-        CREATE TABLE t1(id primary key, a integer);
+        CREATE TABLE t1(id  INT primary key, a integer);
         INSERT INTO t1 VALUES(1, 0);
         INSERT INTO t1 VALUES(2, 120);
         INSERT INTO t1 VALUES(3, -120);
@@ -259,7 +166,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "types-2.2.1",
     [[
-        CREATE TABLE t2(id primary key, a float);
+        CREATE TABLE t2(id  INT primary key, a float);
         INSERT INTO t2 VALUES(1, 0.0);
         INSERT INTO t2 VALUES(2, 12345.678);
         INSERT INTO t2 VALUES(3, -12345.678);
@@ -295,7 +202,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "types-2.3.1",
     [[
-        CREATE TABLE t3(id primary key, a nullvalue);
+        CREATE TABLE t3(id  INT primary key, a INT null);
         INSERT INTO t3 VALUES(1, NULL);
     ]], {
         -- <types-2.3.1>
@@ -333,7 +240,7 @@ test:do_test(
     "types-2.4.1",
     function()
         return test:execsql(string.format([[
-            CREATE TABLE t4(id primary key, a string);
+            CREATE TABLE t4(id  INT primary key, a TEXT);
             INSERT INTO t4 VALUES(1, '%s');
             INSERT INTO t4 VALUES(2, '%s');
             INSERT INTO t4 VALUES(3, '%s');
@@ -354,42 +261,4 @@ test:do_execsql_test(
         -- </types-2.4.2>
     })
 
-test:do_execsql_test(
-    "types-2.5.1",
-    [[
-        DROP TABLE t1;
-        DROP TABLE t2;
-        DROP TABLE t3;
-        DROP TABLE t4;
-        CREATE TABLE t1(id primary key, a, b, c);
-    ]], {
-        -- <types-2.5.1>
-
-        -- </types-2.5.1>
-    })
-
-test:do_test(
-    "types-2.5.2",
-    function()
-        test:execsql("INSERT INTO t1 VALUES(1, NULL, '"..string10.."', 4000);")
-        test:execsql("INSERT INTO t1 VALUES(2, '"..string500.."', 4000, NULL);")
-        return test:execsql("INSERT INTO t1 VALUES(3, 4000, NULL, '"..string500000.."');")
-    end, {
-        -- <types-2.5.2>
-
-        -- </types-2.5.2>
-    })
-
-test:do_execsql_test(
-    "types-2.5.3",
-    [[
-        SELECT a,b,c FROM t1;
-    ]], {
-        -- <types-2.5.3>
-        "", string10, 4000, string500, 4000, "", 4000, "", string500000
-        -- </types-2.5.3>
-    })
-
-
-
 test:finish_test()
diff --git a/test/sql-tap/types2.test.lua b/test/sql-tap/types2.test.lua
index 06817aa18..6b10bc226 100755
--- a/test/sql-tap/types2.test.lua
+++ b/test/sql-tap/types2.test.lua
@@ -36,7 +36,7 @@ test:plan(398)
 -- handled similarly in the implementation.
 test:execsql [[
     CREATE TABLE t1(
-      id primary key,
+      id  INT primary key,
       i1 INTEGER,
       i2 INTEGER,
       n1 NUMERIC,
@@ -79,17 +79,17 @@ end
 -- Changed by ticket #805:  Use no affinity for literal comparisons.
 --
 test_bool("types2-1.1", "", "500 = 500.0", 1)
-test_bool("types2-1.2", "", "'500' = 500.0", 0)
+test_bool("types2-1.2", "", "'500' = 500.0", 1)
 test_bool("types2-1.3", "", "500 = '500.0'", 0)
 test_bool("types2-1.4", "", "'500' = '500.0'", 0)
 -- Compare literals against a column with TEXT affinity
 test_bool("types2-1.5", "t1=500", "500 = t1", 1)
 test_bool("types2-1.6", "t1=500", "'500' = t1", 1)
-test_bool("types2-1.7", "t1=500", "500.0 = t1", 0)
+test_bool("types2-1.7", "t1=500", "500.0 = t1", 1)
 test_bool("types2-1.8", "t1=500", "'500.0' = t1", 0)
 test_bool("types2-1.9", "t1='500'", "500 = t1", 1)
 test_bool("types2-1.10", "t1='500'", "'500' = t1", 1)
-test_bool("types2-1.11", "t1='500'", "500.0 = t1", 0)
+test_bool("types2-1.11", "t1='500'", "500.0 = t1", 1)
 test_bool("types2-1.12", "t1='500'", "'500.0' = t1", 0)
 -- Compare literals against a column with NUMERIC affinity
 test_bool("types2-1.13", "n1=500", "500 = n1", 1)
@@ -112,7 +112,7 @@ test_bool("types2-1.28", "o1='500'", "'500.0' = o1", 0)
 local vals = { 10, "10.0", "'10'", "'10.0'", 20, "20.0", "'20'", "'20.0'", 30, "30.0", "'30'", "'30.0'" }
 --             1    2      3         4      5  6       7        8      9    10       11   12
 test:execsql [[
-    CREATE TABLE t2(id primary key, i INTEGER, n NUMERIC, t TEXT, o XBLOBY);
+    CREATE TABLE t2(id  INT primary key, i INTEGER, n NUMERIC, t TEXT, o XBLOBY);
     CREATE INDEX t2i1 ON t2(i);
     CREATE INDEX t2i2 ON t2(n);
     CREATE INDEX t2i3 ON t2(t);
@@ -274,7 +274,7 @@ test_boolset("types2-6.9", "id IN (1, 6, 10)", {1, 6, 10})
 -- Tests types2-7.* concentrate on expressions of the form 
 -- "x IN (SELECT...)" with no index.
 test:execsql [[
-    CREATE TABLE t3(id primary key, i INTEGER, n NUMERIC, t TEXT, o BLOB);
+    CREATE TABLE t3(id  INT primary key, i INTEGER, n NUMERIC, t TEXT, o BLOB);
     INSERT INTO t3 VALUES(1, 1, 1, 1, 1);
     INSERT INTO t3 VALUES(2, 2, 2, 2, 2);
     INSERT INTO t3 VALUES(3, 3, 3, 3, 3);
@@ -306,7 +306,7 @@ test_bool("types2-7.15", "o1='2'", "o1 IN (SELECT o||'' FROM t3)", 1)
 -- set vals [list 10 10.0 '10' '10.0' 20 20.0 '20' '20.0' 30 30.0 '30' '30.0']
 --                1  2    3    4      5  6    7    8      9  10   11   12
 test:execsql [[
-    CREATE TABLE t4(id primary key, i INTEGER, n NUMERIC, t VARCHAR(20), o LARGE BLOB);
+    CREATE TABLE t4(id  INT primary key, i INTEGER, n NUMERIC, t VARCHAR(20), o  INT LARGE BLOB);
     INSERT INTO t4 VALUES(1, 10, 20, 20, 30);
 ]]
 test_boolset("types2-8.1", "i IN (SELECT i FROM t4)", {1, 2, 3, 4})
diff --git a/test/sql-tap/unique.test.lua b/test/sql-tap/unique.test.lua
index 3856d26f8..5e2685d0d 100755
--- a/test/sql-tap/unique.test.lua
+++ b/test/sql-tap/unique.test.lua
@@ -131,7 +131,7 @@ test:do_execsql_test(
     "unique-2.0",
     [[
         DROP TABLE t1;
-        CREATE TABLE t2(id primary key, a int, b int);
+        CREATE TABLE t2(id int primary key, a int, b int);
         INSERT INTO t2(id, a,b) VALUES(1, 1,2);
         INSERT INTO t2(id, a,b) VALUES(2, 3,4);
         SELECT a,b FROM t2 ORDER BY a;
@@ -245,7 +245,7 @@ test:do_catchsql_test(
     "unique-3.1",
     [[
         CREATE TABLE t3(
-          id primary key,
+          id int primary key,
            a int,
            b int,
            c int,
@@ -299,7 +299,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "unique-4.1",
     [[
-        CREATE TABLE t4(id primary key,a UNIQUE, b, c, UNIQUE(b,c));
+        CREATE TABLE t4(id int primary key,a int UNIQUE, b int, c int, UNIQUE(b,c));
         INSERT INTO t4 VALUES(1,1,2,3);
         INSERT INTO t4 VALUES(2, NULL, 2, NULL);
         SELECT a,b,c FROM t4;
@@ -414,13 +414,13 @@ test:do_execsql_test(
     "unique-5.1",
     [[
         CREATE TABLE t5(
-          id primary key,
-          first_column_with_long_name,
-          second_column_with_long_name,
-          third_column_with_long_name,
-          fourth_column_with_long_name,
-          fifth_column_with_long_name,
-          sixth_column_with_long_name,
+          id  INT primary key,
+          first_column_with_long_name INT ,
+          second_column_with_long_name INT ,
+          third_column_with_long_name INT ,
+            fourth_column_with_long_name INT ,
+          fifth_column_with_long_name INT ,
+          sixth_column_with_long_name INT ,
           UNIQUE(
             first_column_with_long_name,
             second_column_with_long_name,
diff --git a/test/sql-tap/update.test.lua b/test/sql-tap/update.test.lua
index d4debc74f..a0b8cf45d 100755
--- a/test/sql-tap/update.test.lua
+++ b/test/sql-tap/update.test.lua
@@ -39,7 +39,7 @@ test:do_catchsql_test("update-1.1", [[
 -- Create a table to work with
 --
 test:do_test("update-3.1", function()
-  test:execsql "CREATE TABLE test1(id primary key, f1 int,f2 int)"
+  test:execsql "CREATE TABLE test1(id  INT primary key, f1 int,f2 int)"
   -- for _ in X(0, "X!for", [=[["set i 1","$i<=10","incr i"]]=]) do
   for i = 1, 10 do    
     sql = string.format("INSERT INTO test1 VALUES(%s,%s,%s)", i, i, bit.lshift(1, i)) -- X(0, "X!expr", [=[["<<",1,["i"]]]=]))
@@ -889,9 +889,9 @@ test:do_execsql_test("update-10.1", [[
   DROP TABLE test1;
   CREATE TABLE t1(
      a integer primary key,
-     b UNIQUE, 
-     c, d,
-     e, f,
+     b  INT UNIQUE, 
+     c INT , d INT ,
+     e INT , f INT ,
      UNIQUE(c,d)
   );
   INSERT INTO t1 VALUES(1,2,3,4,5,6);
@@ -1012,7 +1012,7 @@ test:do_catchsql_test("update-10.10", [[
 -- do_test update-13.1 {
 --   execsql {
 --     BEGIN;
---     CREATE TABLE t2(id primary key, a);
+--     CREATE TABLE t2(id  INT primary key, a INT );
 --     INSERT INTO t2 VALUES(1, 1);
 --     INSERT INTO t2 VALUES(2, 2);
 --     INSERT INTO t2 SELECT id+2,a+2 FROM t2;
@@ -1070,7 +1070,7 @@ test:do_catchsql_test("update-10.10", [[
 -- #
 -- do_test update-14.1 {
 --   execsql {
---     CREATE TABLE t3(a,b,c);
+--     CREATE TABLE t3(a INT ,b INT ,c INT );
 --     CREATE TRIGGER t3r1 BEFORE UPDATE on t3 WHEN nosuchcol BEGIN
 --       SELECT 'illegal WHEN clause';
 --     END;
@@ -1083,7 +1083,7 @@ test:do_catchsql_test("update-10.10", [[
 -- } {1 {no such column: nosuchcol}}
 -- do_test update-14.3 {
 --   execsql {
---     CREATE TABLE t4(a,b,c);
+--     CREATE TABLE t4(a INT ,b INT ,c INT );
 --     CREATE TRIGGER t4r1 AFTER UPDATE on t4 WHEN nosuchcol BEGIN
 --       SELECT 'illegal WHEN clause';
 --     END;
@@ -1100,7 +1100,7 @@ test:do_catchsql_test("update-10.10", [[
 -- # An assertion fault on UPDATE
 -- #
 -- do_execsql_test update-15.1 {
---   CREATE TABLE t15(a INTEGER PRIMARY KEY, b);
+--   CREATE TABLE t15(a INTEGER PRIMARY KEY, b INT );
 --   INSERT INTO t15(a,b) VALUES(10,'abc'),(20,'def'),(30,'ghi');
 --   ALTER TABLE t15 ADD COLUMN c;
 --   CREATE INDEX t15c ON t15(c);
@@ -1113,7 +1113,7 @@ test:do_catchsql_test("update-10.10", [[
 test:do_execsql_test(
     "insert-15.0",
     [[
-        create table test(a primary key);
+        create table test(a int primary key);
         insert into test(a) values(1);
     ]])
 
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index edb475434..d9ad62352 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -25,7 +25,7 @@ test:plan(74)
 -- ORIGINAL_TEST
 -- do_test view-1.0 {
 --   execsql {
---     CREATE TABLE t1(a,b,c);
+--     CREATE TABLE t1(a INT,b INT,c INT);
 --     INSERT INTO t1 VALUES(1,2,3);
 --     INSERT INTO t1 VALUES(4,5,6);
 --     INSERT INTO t1 VALUES(7,8,9);
@@ -36,7 +36,7 @@ test:plan(74)
 test:do_execsql_test(
     "view-1.0",
     [[
-        CREATE TABLE t1(a primary key,b,c);
+        CREATE TABLE t1(a INT primary key,b INT,c INT);
         INSERT INTO t1 VALUES(1,2,3);
         INSERT INTO t1 VALUES(4,5,6);
         INSERT INTO t1 VALUES(7,8,9);
@@ -145,7 +145,7 @@ test:do_catchsql_test(
 -- ORIGINAL_TEST
 -- do_test view-1.7 {
 --   execsql {
---     CREATE TABLE t1(x,a,b,c);
+--     CREATE TABLE t1(x INT,a INT,b INT,c INT);
 --     INSERT INTO t1 VALUES(1,2,3,4);
 --     INSERT INTO t1 VALUES(4,5,6,7);
 --     INSERT INTO t1 VALUES(7,8,9,10);
@@ -155,7 +155,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "view-1.8",
     [[
-        CREATE TABLE t1(x primary key,a,b,c);
+        CREATE TABLE t1(x INT primary key,a INT,b INT,c INT);
         INSERT INTO t1 VALUES(1,2,3,4);
         INSERT INTO t1 VALUES(4,5,6,7);
         INSERT INTO t1 VALUES(7,8,9,10);
@@ -395,7 +395,7 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "view-5.1",
     [[
-        CREATE TABLE t2(y primary key,a);
+        CREATE TABLE t2(y INT primary key,a INT);
         INSERT INTO t2 VALUES(22,2);
         INSERT INTO t2 VALUES(33,3);
         INSERT INTO t2 VALUES(44,4);
@@ -504,8 +504,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "view-7.1",
     [[
-        CREATE TABLE test1(id integer primary key, a);
-        CREATE TABLE test2(id integer primary key, b);
+        CREATE TABLE test1(id integer primary key, a INT);
+        CREATE TABLE test2(id integer primary key, b INT);
         INSERT INTO test1 VALUES(1,2);
         INSERT INTO test2 VALUES(1,3);
         CREATE VIEW test AS
@@ -799,7 +799,7 @@ if (0 > 0)
     test:do_execsql_test(
         "view-11.1",
         [[
-            CREATE TABLE t4(a COLLATE "unicode_ci" primary key);
+            CREATE TABLE t4(a TEXT COLLATE "unicode_ci" primary key);
             INSERT INTO t4 VALUES('This');
             INSERT INTO t4 VALUES('this');
             INSERT INTO t4 VALUES('THIS');
@@ -814,7 +814,7 @@ if (0 > 0)
     test:do_execsql_test(
         "view-11.1",
         [[
-            CREATE TABLE t4(a COLLATE "unicode_ci" primary key);
+            CREATE TABLE t4(a TEXT COLLATE "unicode_ci" primary key);
             INSERT INTO t4 VALUES('This');
             INSERT INTO t4 VALUES('this');
             INSERT INTO t4 VALUES('THIS');
@@ -878,7 +878,7 @@ test:do_catchsql_test(
 --     forcedelete test2.db
 --     catchsql {
 --       ATTACH 'test2.db' AS two;
---       CREATE TABLE two.t2(x,y);
+--       CREATE TABLE two.t2(x INT,y INT);
 --       CREATE VIEW v13 AS SELECT y FROM two.t2;
 --     }
 --   } {1 {view v13 cannot reference objects in database two}}
@@ -888,7 +888,7 @@ test:do_catchsql_test(
 --    forcedelete test2.db
 --    catchsql {
 --      ATTACH 'test2.db' AS two;
---      CREATE TABLE two.t2(x primary key,y);
+--      CREATE TABLE two.t2(x INT primary key,y INT);
 --      CREATE VIEW v13 AS SELECT y FROM two.t2;
 --    }
 --  } {1 {view v13 cannot reference objects in database two}}
@@ -989,7 +989,7 @@ if (0 > 0)
         [[
             DROP VIEW t1;
             DROP TABLE t1;
-            CREATE TABLE t1(a, b, c);
+            CREATE TABLE t1(a INT, b INT, c INT);
             INSERT INTO t1 VALUES(1, 2, 3);
             INSERT INTO t1 VALUES(4, 5, 6);
 
@@ -1059,7 +1059,7 @@ test:do_execsql_test(
     "view-20.1",
     [[
         DROP VIEW v10;
-        CREATE TABLE t10(c1 primary key);
+        CREATE TABLE t10(c1 INT primary key);
         CREATE VIEW v10 AS SELECT c1 FROM (SELECT t10.c1 FROM t10);
     ]], {
         -- <view-20.1>
@@ -1072,7 +1072,7 @@ test:do_execsql_test(
     [[
         DROP VIEW IF EXISTS v10;
         DROP TABLE IF EXISTS t10;
-        CREATE TABLE t10(c1 primary key);
+        CREATE TABLE t10(c1 INT primary key);
         CREATE VIEW v10 AS SELECT c1 FROM (SELECT t10.c1 FROM t10);
     ]], {
         -- <view-20.1>
@@ -1096,7 +1096,7 @@ if (0 > 0)
     test:do_catchsql_test(
         "view-21.1",
         [[
-            CREATE TABLE t1(x primary key);
+            CREATE TABLE t1(x INT primary key);
             INSERT INTO t1 VALUES(5);
             CREATE VIEW v1 AS SELECT x*2 FROM t1;
             CREATE VIEW v2 AS SELECT * FROM v1 UNION SELECT * FROM v1;
diff --git a/test/sql-tap/where2.test.lua b/test/sql-tap/where2.test.lua
index e65799600..8e30f11cb 100755
--- a/test/sql-tap/where2.test.lua
+++ b/test/sql-tap/where2.test.lua
@@ -206,7 +206,7 @@ test:do_test(
     "where2-2.4",
     function()
         test:execsql [[
-            CREATE TABLE x1(a INTEGER PRIMARY KEY, b DEFAULT 1);
+            CREATE TABLE x1(a INTEGER PRIMARY KEY, b INT DEFAULT 1);
             WITH RECURSIVE
                cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<50)
             INSERT INTO x1 SELECT x, 1 FROM cnt;
@@ -880,10 +880,10 @@ test:do_test(
         "where2-7.1",
         function()
             return cksort([[
-    create table t8(a PRIMARY KEY, b, c);
+    create table t8(a INT PRIMARY KEY, b INT, c INT);
     insert into t8 values(1,2,3);
     insert into t8 values(2,3,4);
-    create table t9(x,y, PRIMARY key (x, y));
+    create table t9(x INT,y INT, PRIMARY key (x, y));
     insert into t9 values(2,4);
     insert into t9 values(2,3);
     select y from t8, t9 where a=1 order by a, y;
@@ -1213,7 +1213,7 @@ test:do_execsql_test(
         "where2-9.1",
         function()
             test:execsql [[
-                CREATE TABLE t10(id int PRIMARY KEY,a,b,c);
+                CREATE TABLE t10(id int PRIMARY KEY,a INT,b INT,c INT);
                 START TRANSACTION;
                 INSERT INTO t10 VALUES(1, 1,1,1);
                 INSERT INTO t10 VALUES(2, 1,2,2);
@@ -1316,7 +1316,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "where2-13.1",
     [[
-        CREATE TABLE t13(a primary key,b);
+        CREATE TABLE t13(a INT primary key,b INT);
         INSERT INTO t13 VALUES(4,5);
         SELECT * FROM t13 WHERE (1=2 AND a=3) OR a=4;
     ]], {
diff --git a/test/sql-tap/where3.test.lua b/test/sql-tap/where3.test.lua
index 45827373f..7ae964b88 100755
--- a/test/sql-tap/where3.test.lua
+++ b/test/sql-tap/where3.test.lua
@@ -29,9 +29,9 @@ test:plan(83)
 test:do_execsql_test(
     "where3-1.1",
     [[
-        CREATE TABLE t1(a primary key, b);
-        CREATE TABLE t2(p primary key, q);
-        CREATE TABLE t3(x primary key, y);
+        CREATE TABLE t1(a  INT primary key, b TEXT);
+        CREATE TABLE t2(p  INT primary key, q INT );
+        CREATE TABLE t3(x  INT primary key, y TEXT);
 
         INSERT INTO t1 VALUES(111,'one');
         INSERT INTO t1 VALUES(222,'two');
@@ -65,9 +65,9 @@ test:do_test(
 test:do_execsql_test(
     "where3-1.2",
     [[
-        CREATE TABLE test1(parent1key primary key, child1key, Child2key, child3key);
-        CREATE TABLE child1 ( child1key NVARCHAR primary key, value NVARCHAR );
-        CREATE TABLE child2 ( child2key NVARCHAR primary key, value NVARCHAR );
+        CREATE TABLE test1(parent1key  INT primary key, child1key TEXT, Child2key TEXT , child3key INT );
+        CREATE TABLE child1 ( child1key  TEXT primary key, value  TEXT );
+        CREATE TABLE child2 ( child2key  TEXT primary key, value  TEXT );
 
         INSERT INTO test1(parent1key,child1key,child2key)
            VALUES ( 1, 'C1.1', 'C2.1' );
@@ -181,10 +181,10 @@ test:do_test(
     "where3-2.1",
     function()
         test:execsql [[
-            CREATE TABLE tA(apk integer primary key, ax);
-            CREATE TABLE tB(bpk integer primary key, bx);
-            CREATE TABLE tC(cpk integer primary key, cx);
-            CREATE TABLE tD(dpk integer primary key, dx);
+            CREATE TABLE tA(apk integer primary key, ax INT );
+            CREATE TABLE tB(bpk integer primary key, bx INT );
+            CREATE TABLE tC(cpk integer primary key, cx INT );
+            CREATE TABLE tD(dpk integer primary key, dx INT );
         ]]
         return queryplan([[
     SELECT * FROM tA, tB, tC LEFT JOIN tD ON dpk=cx
@@ -347,11 +347,11 @@ test:do_test(
 test:do_execsql_test(
     "where3-3.0",
     [[
-        CREATE TABLE t301(a INTEGER PRIMARY KEY,b,c);
+        CREATE TABLE t301(a INTEGER PRIMARY KEY,b INT ,c INT );
         CREATE INDEX t301c ON t301(c);
         INSERT INTO t301 VALUES(1,2,3);
         INSERT INTO t301 VALUES(2,2,3);
-        CREATE TABLE t302(x primary key, y);
+        CREATE TABLE t302(x  INT primary key, y INT );
         INSERT INTO t302 VALUES(4,5);
         SELECT * FROM t302, t301 WHERE t302.x=5 AND t301.a=t302.y;
     ]], {
@@ -400,9 +400,9 @@ if 0
     test:do_execsql_test(
         "where3-4.0",
         [[
-            CREATE TABLE t400(a INTEGER PRIMARY KEY, b, c);
-            CREATE TABLE t401(p INTEGER PRIMARY KEY, q, r);
-            CREATE TABLE t402(x INTEGER PRIMARY KEY, y, z);
+            CREATE TABLE t400(a INTEGER PRIMARY KEY, b INT , c INT );
+            CREATE TABLE t401(p INTEGER PRIMARY KEY, q INT , r INT );
+            CREATE TABLE t402(x INTEGER PRIMARY KEY, y INT , z INT );
             EXPLAIN QUERY PLAN
             SELECT * FROM t400, t401, t402 WHERE t402.z GLOB 'abc*';
         ]], {
@@ -442,16 +442,16 @@ test:do_execsql_test(
     "where3-5.0",
     [[
         CREATE TABLE aaa (id INTEGER PRIMARY KEY, type INTEGER,
-                          fk INTEGER DEFAULT NULL, parent INTEGER,
-                          position INTEGER, title LONGVARCHAR,
+                          fk TEXT DEFAULT NULL, parent INTEGER,
+                          position INTEGER, title TEXT,
                           keyword_id INTEGER, folder_type TEXT,
                           dateAdded INTEGER, lastModified INTEGER);
         CREATE INDEX aaa_111 ON aaa (fk, type);
         CREATE INDEX aaa_222 ON aaa (parent, position);
         CREATE INDEX aaa_333 ON aaa (fk, lastModified);
         CREATE TABLE bbb (id INTEGER PRIMARY KEY, type INTEGER,
-                          fk INTEGER DEFAULT NULL, parent INTEGER,
-                          position INTEGER, title LONGVARCHAR,
+                          fk TEXT DEFAULT NULL, parent INTEGER,
+                          position INTEGER, title TEXT,
                           keyword_id INTEGER, folder_type TEXT,
                           dateAdded INTEGER, lastModified INTEGER);
         CREATE INDEX bbb_111 ON bbb (fk, type);
@@ -515,19 +515,19 @@ test:do_test(
     "where3-6.setup",
     function()
         return test:execsql [[
-            CREATE TABLE t6w(a primary key, w);
+            CREATE TABLE t6w(a  INT primary key, w TEXT);
             INSERT INTO t6w VALUES(1, 'w-one');
             INSERT INTO t6w VALUES(2, 'w-two');
             INSERT INTO t6w VALUES(9, 'w-nine');
-            CREATE TABLE t6x(a primary key, x);
+            CREATE TABLE t6x(a  INT primary key, x TEXT);
             INSERT INTO t6x VALUES(1, 'x-one');
             INSERT INTO t6x VALUES(3, 'x-three');
             INSERT INTO t6x VALUES(9, 'x-nine');
-            CREATE TABLE t6y(a primary key, y);
+            CREATE TABLE t6y(a  INT primary key, y TEXT);
             INSERT INTO t6y VALUES(1, 'y-one');
             INSERT INTO t6y VALUES(4, 'y-four');
             INSERT INTO t6y VALUES(9, 'y-nine');
-            CREATE TABLE t6z(a primary key, z);
+            CREATE TABLE t6z(a  INT primary key, z TEXT);
             INSERT INTO t6z VALUES(1, 'z-one');
             INSERT INTO t6z VALUES(5, 'z-five');
             INSERT INTO t6z VALUES(9, 'z-nine');
@@ -637,10 +637,10 @@ end
 test:do_execsql_test(
     "where3-7-setup",
     [[
-        CREATE TABLE t71(x1 INTEGER PRIMARY KEY, y1);
-        CREATE TABLE t72(x2 INTEGER PRIMARY KEY, y2);
-        CREATE TABLE t73(x3 primary key, y3);
-        CREATE TABLE t74(x4, y4 primary key);
+        CREATE TABLE t71(x1 INTEGER PRIMARY KEY, y1 INT );
+        CREATE TABLE t72(x2 INTEGER PRIMARY KEY, y2 INT );
+        CREATE TABLE t73(x3  INT primary key, y3 INT );
+        CREATE TABLE t74(x4 INT , y4  INT primary key);
         INSERT INTO t71 VALUES(123,234);
         INSERT INTO t72 VALUES(234,345);
         INSERT INTO t73 VALUES(123,234);
diff --git a/test/sql-tap/where4.test.lua b/test/sql-tap/where4.test.lua
index 5ed9e994d..0b687a8d9 100755
--- a/test/sql-tap/where4.test.lua
+++ b/test/sql-tap/where4.test.lua
@@ -33,14 +33,10 @@ test:do_execsql_test(
     [[
         -- Tarantool. As far as rowid was replaced w/ PK - no NULLs allowed anymore.
         -- Comment those lines.
-            CREATE TABLE t1(w, x, y, primary key (w,x,y));
-            INSERT INTO t1 VALUES(1,2,3);
-        --    INSERT INTO t1 VALUES(1,NULL,3);
+            CREATE TABLE t1(w TEXT, x TEXT, y TEXT, primary key (w,x,y));
+            INSERT INTO t1 VALUES('1','2','3');
             INSERT INTO t1 VALUES('a','b','c');
-        --    INSERT INTO t1 VALUES('a',NULL,'c');
-            INSERT INTO t1 VALUES(X'78',x'79',x'7a');
-        --    INSERT INTO t1 VALUES(X'78',NULL,X'7A');
-        --    INSERT INTO t1 VALUES(NULL,NULL,NULL);
+            INSERT INTO t1 VALUES('78','79','7a');
             SELECT count(*) FROM t1;
     ]], {
         -- <where4-1.0>
@@ -134,11 +130,11 @@ test:do_execsql_test(
 -- Tarantool. As far as NULLs are prohibited for PKs (was UNIQUE + rowid) - block 4-3.* completely
 -- do_test where4-3.1 {
 --   execsql {
---     CREATE TABLE t2(a primary key);
+--     CREATE TABLE t2(a INT primary key);
 --     INSERT INTO t2 VALUES(1);
 --     INSERT INTO t2 VALUES(2);
 --     INSERT INTO t2 VALUES(3);
---     CREATE TABLE t3(x,y, primary key("x", 'y')); -- Goofy syntax allowed
+--     CREATE TABLE t3(x INT,y INT, primary key("x", 'y')); -- Goofy syntax allowed
 --     INSERT INTO t3 VALUES(1,11);
 --     INSERT INTO t3 VALUES(2,NULL);
 --     SELECT * FROM t2 LEFT JOIN t3 ON a=x WHERE +y IS NULL;
@@ -216,17 +212,17 @@ test:do_execsql_test(
 
 -- Ticket #2273.  Problems with IN operators and NULLs.
 --
--- X(203, "X!cmd", [=[["ifcapable","subquery","\ndo_test where4-5.1 {\n  execsql {\n    -- Allow the 'x' syntax for backwards compatibility\n    CREATE TABLE t4(x,y,z,PRIMARY KEY('x' ASC, \"y\" ASC));\n  } } {}\n# execsql {\n#   SELECT *\n#     FROM t2 LEFT JOIN t4 b1\n#             LEFT JOIN t4 b2 ON b2.x=b1.x AND b2.y IN (b1.y);\n# }\n# ","1 {} {} {} {} {} {} 2 {} {} {} {} {} {} 3 {} {} {} {} {} {}"]]=])
+-- X(203, "X!cmd", [=[["ifcapable","subquery","\ndo_test where4-5.1 {\n  execsql {\n    -- Allow the 'x' syntax for backwards compatibility\n    CREATE TABLE t4(x INT,y INT,z INT,PRIMARY KEY('x' ASC, \"y\" ASC));\n  } } {}\n# execsql {\n#   SELECT *\n#     FROM t2 LEFT JOIN t4 b1\n#             LEFT JOIN t4 b2 ON b2.x=b1.x AND b2.y IN (b1.y);\n# }\n# ","1 {} {} {} {} {} {} 2 {} {} {} {} {} {} 3 {} {} {} {} {} {}"]]=])
 test:do_execsql_test(
     "where4-5.1",
     [[
-        CREATE TABLE t2(a primary key);
+        CREATE TABLE t2(a INT primary key);
         INSERT INTO t2 VALUES(1);
         INSERT INTO t2 VALUES(2);
         INSERT INTO t2 VALUES(3);
 
         -- Allow the 'x' syntax for backwards compatibility
-        CREATE TABLE t4(x,y,z,PRIMARY KEY(x ASC, y ASC));
+        CREATE TABLE t4(x INT,y INT,z INT,PRIMARY KEY(x ASC, y ASC));
 
         SELECT *
           FROM t2 LEFT JOIN t4 b1
@@ -259,7 +255,7 @@ test:do_execsql_test(
 -- } {1 2 4}
 -- do_test where4-6.1 {
 --   execsql {
---     CREATE TABLE t5(a,b,c,d,e,f,UNIQUE(a,b,c,d,e,f));
+--     CREATE TABLE t5(a INT,b INT,c INT,d INT,e INT,f INT,UNIQUE INT (a,b INT,c INT,d INT,e INT,f INT));
 --     INSERT INTO t5 VALUES(1,1,1,1,1,11111);
 --     INSERT INTO t5 VALUES(2,2,2,2,2,22222);
 --     INSERT INTO t5 VALUES(1,2,3,4,5,12345);
@@ -280,7 +276,7 @@ test:do_test(
     "where4-7.1",
     function()
         test:execsql [[
-            CREATE TABLE t6(y,z,PRIMARY KEY(y,z));
+            CREATE TABLE t6(y INT,z INT,PRIMARY KEY(y,z));
         ]]
         return test:execsql [[
             SELECT * FROM t6 WHERE y=NULL AND z IN ('hello');
@@ -295,9 +291,9 @@ test:do_test(
 -- do_test where4-7.1 {
 --   execsql {
 --     BEGIN;
---     CREATE TABLE t8(a primary key, b, c, d);
+--     CREATE TABLE t8(a INT primary key, b INT, c INT, d INT);
 --     CREATE INDEX t8_i ON t8(a, b, c);
---     CREATE TABLE t7(i primary key);
+--     CREATE TABLE t7(i INT primary key);
 --     INSERT INTO t7 VALUES(1);
 --     INSERT INTO t7 SELECT i*2 FROM t7;
 --     INSERT INTO t7 SELECT i*2 FROM t7;
@@ -326,7 +322,7 @@ test:do_test(
 -- # correctly.
 -- unset -nocomplain null
 -- do_execsql_test 8.1 {
---   CREATE TABLE u9(a UNIQUE, b);
+--   CREATE TABLE u9(a INT UNIQUE, b INT);
 --   INSERT INTO u9 VALUES(NULL, 1);
 --   INSERT INTO u9 VALUES(NULL, 2);
 -- }
diff --git a/test/sql-tap/where5.test.lua b/test/sql-tap/where5.test.lua
index 5ba0ada12..fb8820ba5 100755
--- a/test/sql-tap/where5.test.lua
+++ b/test/sql-tap/where5.test.lua
@@ -25,7 +25,7 @@ test:plan(50)
 test:do_test("where5-1.0", function()
     test:execsql [[
         CREATE TABLE t1(x TEXT primary key);
-        CREATE TABLE t2(x integet primary key);
+        CREATE TABLE t2(x integer primary key);
         CREATE TABLE t3(x integer PRIMARY KEY);
         INSERT INTO t1 VALUES(-1);
         INSERT INTO t1 VALUES(0);
diff --git a/test/sql-tap/where6.test.lua b/test/sql-tap/where6.test.lua
index bdf6c6d4d..f98ad3ba5 100755
--- a/test/sql-tap/where6.test.lua
+++ b/test/sql-tap/where6.test.lua
@@ -25,7 +25,7 @@ test:plan(20)
 test:do_execsql_test(
     "where6-1.1",
     [[
-        CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY,b INT ,c INT );
         INSERT INTO t1 VALUES(1,3,1);
         INSERT INTO t1 VALUES(2,4,2);
         CREATE TABLE t2(x INTEGER PRIMARY KEY);
@@ -239,11 +239,11 @@ test:do_test(
     "where6-3.1",
     function()
         return test:execsql [[
-            CREATE TABLE t4(x PRIMARY key);
+            CREATE TABLE t4(x TEXT PRIMARY key);
             INSERT INTO t4 VALUES('abc');
             INSERT INTO t4 VALUES('def');
             INSERT INTO t4 VALUES('ghi');
-            CREATE TABLE t5(a, b, c, PRIMARY KEY(a,b));
+            CREATE TABLE t5(a TEXT, b TEXT , c INT , PRIMARY KEY(a,b));
             INSERT INTO t5 VALUES('abc','def',123);
             INSERT INTO t5 VALUES('def','ghi',456);
 
diff --git a/test/sql-tap/where7.test.lua b/test/sql-tap/where7.test.lua
index 6691dd03b..ab53f8728 100755
--- a/test/sql-tap/where7.test.lua
+++ b/test/sql-tap/where7.test.lua
@@ -42,7 +42,7 @@ end
 test:do_execsql_test(
     "where7-1.1",
     [[
-        CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c,d);
+        CREATE TABLE t1(a INTEGER PRIMARY KEY,b INT,c INT,d INT);
         INSERT INTO t1 VALUES(1,2,3,4);
         INSERT INTO t1 VALUES(2,3,4,5);
         INSERT INTO t1 VALUES(3,4,6,8);
@@ -320,7 +320,7 @@ test:do_test(
     "where7-2.1",
     function()
         return test:execsql [[
-            CREATE TABLE t2(a INTEGER PRIMARY KEY,b,c,d,e,f TEXT,g);
+            CREATE TABLE t2(a INTEGER PRIMARY KEY,b INT,c INT,d REAL,e REAL,f TEXT,g TEXT);
             INSERT INTO t2 VALUES(1,11,1001,1.001,100.1,'bcdefghij','yxwvuts');
             INSERT INTO t2 VALUES(2,22,1001,2.002,100.1,'cdefghijk','yxwvuts');
             INSERT INTO t2 VALUES(3,33,1001,3.0029999999999997,100.1,'defghijkl','xwvutsr');
@@ -427,7 +427,7 @@ test:do_test(
             CREATE INDEX t2e ON t2(e);
             CREATE INDEX t2f ON t2(f);
             CREATE INDEX t2g ON t2(g);
-            CREATE TABLE t3(a INTEGER PRIMARY KEY,b,c,d,e,f TEXT,g);
+            CREATE TABLE t3(a INTEGER PRIMARY KEY,b INT,c INT,d REAL,e REAL,f TEXT,g TEXT);
             INSERT INTO t3 SELECT * FROM t2;
             CREATE INDEX t3b ON t3(b,c);
             CREATE INDEX t3c ON t3(c,e);
diff --git a/test/sql-tap/whereA.test.lua b/test/sql-tap/whereA.test.lua
index 773023e01..488df9592 100755
--- a/test/sql-tap/whereA.test.lua
+++ b/test/sql-tap/whereA.test.lua
@@ -23,15 +23,15 @@ test:do_test(
     "whereA-1.1",
     function()
         return test:execsql [[
-            CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE, c);
-            INSERT INTO t1 VALUES(1,2,3);
-            INSERT INTO t1 values(2,'hello','world');
+            CREATE TABLE t1(a INTEGER PRIMARY KEY, b REAL UNIQUE, c TEXT);
+            INSERT INTO t1 VALUES(1,2,'3');
+            INSERT INTO t1 values(2,55,'world');
             INSERT INTO t1 VALUES(3,4.53,NULL);
             SELECT * FROM t1
         ]]
     end, {
         -- <whereA-1.1>
-        1, 2, 3, 2, "hello", "world", 3, 4.53, ""
+        1, 2, '3', 2, 55, "world", 3, 4.53, ""
         -- </whereA-1.1>
     })
 
@@ -44,7 +44,7 @@ test:do_test(
         ]]
     end, {
         -- <whereA-1.2>
-        3, 4.53, "", 2, "hello", "world", 1, 2, 3
+        3, 4.53, "", 2, 55, "world", 1, 2, '3'
         -- </whereA-1.2>
     })
 
@@ -60,7 +60,7 @@ test:do_test(
         ]]
     end, {
         -- <whereA-1.3>
-        3, 4.53, "", 2, "hello", "world", 1, 2, 3
+        3, 4.53, "", 2, 55, "world", 1, 2, '3'
         -- </whereA-1.3>
     })
 
@@ -100,7 +100,7 @@ test:do_execsql_test(
         SELECT * FROM t1 WHERE b=2 AND a IS NOT NULL;
     ]], {
         -- <whereA-1.9>
-        1, 2, 3
+        1, 2, '3'
         -- </whereA-1.9>
     })
 
@@ -113,7 +113,7 @@ test:do_test(
         ]]
     end, {
         -- <whereA-2.1>
-        1, 2, 3, 2, "hello", "world", 3, 4.53, ""
+        1, 2, '3', 2, 55, "world", 3, 4.53, ""
         -- </whereA-2.1>
     })
 
@@ -126,7 +126,7 @@ test:do_test(
         ]]
     end, {
         -- <whereA-2.2>
-        3, 4.53, "", 2, "hello", "world", 1, 2, 3
+        3, 4.53, "", 2, 55, "world", 1, 2, '3'
         -- </whereA-2.2>
     })
 
@@ -137,7 +137,7 @@ test:do_test(
 --   }
 -- } {1 2 3 2 hello world 3 4.53 {}}
 test:do_test(
-    "whereA-3.1",
+    "whe:reA-3.1",
     function()
         return test:execsql [[
             PRAGMA reverse_unordered_selects=0;
@@ -145,7 +145,7 @@ test:do_test(
         ]]
     end, {
         -- <whereA-3.1>
-        1, 2, 3, 3, 4.53, "", 2, "hello", "world"
+        1, 2, '3', 3, 4.53, "", 2, 55, "world"
         -- </whereA-3.1>
     })
 
@@ -158,7 +158,7 @@ test:do_test(
         ]]
     end, {
         -- <whereA-3.2>
-        2, "hello", "world", 3, 4.53, "", 1, 2, 3
+        2, 55, "world", 3, 4.53, "", 1, 2, '3'
         -- </whereA-3.2>
     })
 
@@ -171,7 +171,7 @@ test:do_test(
         ]]
     end, {
         -- <whereA-3.3>
-        1, 2, 3, 3, 4.53, "", 2, "hello", "world"
+        1, 2, '3', 3, 4.53, "", 2, 55, "world"
         -- </whereA-3.3>
     })
 
@@ -179,7 +179,7 @@ test:do_test(
     "whereA-4.1",
     function()
         return test:execsql [[
-            CREATE TABLE t2(id int primary key, x);
+            CREATE TABLE t2(id int primary key, x INT);
             INSERT INTO t2 VALUES(1, 1);
             INSERT INTO t2 VALUES(2, 2);
             SELECT x FROM t2;
diff --git a/test/sql-tap/whereB.test.lua b/test/sql-tap/whereB.test.lua
index 7b1d29409..c7eb10bf6 100755
--- a/test/sql-tap/whereB.test.lua
+++ b/test/sql-tap/whereB.test.lua
@@ -30,18 +30,18 @@ test:plan(63)
 test:do_execsql_test(
     "whereB-1.1",
     [[
-        CREATE TABLE t1(x primary key,y);    -- affinity of t1.y is NONE
+        CREATE TABLE t1(x  INT primary key,y INT );    -- affinity of t1.y is NONE
         INSERT INTO t1 VALUES(1,99);
 
-        CREATE TABLE t2(a primary key, b TEXT);  -- affinity of t2.b is TEXT
+        CREATE TABLE t2(a  INT primary key, b TEXT);  -- affinity of t2.b is TEXT
         CREATE INDEX t2b ON t2(b);
-        INSERT INTO t2 VALUES(2,99);
+        INSERT INTO t2 VALUES(2,'99');
 
         SELECT x, a, y=b FROM t1, t2 ORDER BY +x, +a;
     ]],
     {
     -- <whereB-1.1>
-    1, 2, 0
+    1, 2, 1
     -- </whereB-1.1>
     })
 
@@ -52,7 +52,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.2>
-    
+    1, 2, 1
     -- </whereB-1.2>
     })
 
@@ -63,7 +63,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.3>
-    
+    1, 2, 1
     -- </whereB-1.3>
     })
 
@@ -74,7 +74,6 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.4>
-    
     -- </whereB-1.4>
     })
 
@@ -86,7 +85,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.100>
-    
+    1, 2, 1
     -- </whereB-1.100>
     })
 
@@ -97,7 +96,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.101>
-    
+    1, 2, 1
     -- </whereB-1.101>
     })
 
@@ -126,12 +125,12 @@ test:do_execsql_test(
         DROP TABLE t1;
         DROP TABLE t2;
 
-        CREATE TABLE t1(x primary key, y TEXT);    -- affinity of t1.y is TEXT
+        CREATE TABLE t1(x  INT primary key, y TEXT);    -- affinity of t1.y is TEXT
         INSERT INTO t1 VALUES(1,99);
 
-        CREATE TABLE t2(a primary key, b BLOB);  -- affinity of t2.b is NONE
+        CREATE TABLE t2(a  INT primary key, b BLOB);  -- affinity of t2.b is NONE
         CREATE INDEX t2b ON t2(b);
-        INSERT INTO t2 VALUES(2,99);
+        INSERT INTO t2 VALUES(2, 99);
 
         SELECT x, a, y=b FROM t1, t2 ORDER BY +x, +a;
     ]],
@@ -222,10 +221,10 @@ test:do_execsql_test(
         DROP TABLE t1;
         DROP TABLE t2;
 
-        CREATE TABLE t1(x primary key, y BLOB);    -- affinity of t1.y is NONE
+        CREATE TABLE t1(x  INT primary key, y BLOB);    -- affinity of t1.y is NONE
         INSERT INTO t1 VALUES(1,99);
 
-        CREATE TABLE t2(a primary key, b BLOB);  -- affinity of t2.b is NONE
+        CREATE TABLE t2(a  INT primary key, b BLOB);  -- affinity of t2.b is NONE
         CREATE INDEX t2b ON t2(b);
         INSERT INTO t2 VALUES(2,'99');
 
@@ -318,10 +317,10 @@ test:do_execsql_test(
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
 
-        CREATE TABLE t1(x primary key, y BLOB);    -- affinity of t1.y is NONE
+        CREATE TABLE t1(x  INT primary key, y BLOB);    -- affinity of t1.y is NONE
         INSERT INTO t1 VALUES(1,'99');
 
-        CREATE TABLE t2(a primary key, b NUMERIC);  -- affinity of t2.b is NUMERIC
+        CREATE TABLE t2(a  INT primary key, b NUMERIC);  -- affinity of t2.b is NUMERIC
         CREATE INDEX t2b ON t2(b);
         INSERT INTO t2 VALUES(2,99);
 
@@ -418,10 +417,10 @@ test:do_execsql_test(
         DROP TABLE t1;
         DROP TABLE t2;
 
-        CREATE TABLE t1(x primary key, y BLOB);    -- affinity of t1.y is NONE
+        CREATE TABLE t1(x  INT primary key, y BLOB);    -- affinity of t1.y is NONE
         INSERT INTO t1 VALUES(1,'99');
 
-        CREATE TABLE t2(a primary key, b INT);  -- affinity of t2.b is INTEGER
+        CREATE TABLE t2(a  INT primary key, b INT);  -- affinity of t2.b is INTEGER
         CREATE INDEX t2b ON t2(b);
         INSERT INTO t2 VALUES(2,99);
 
@@ -518,10 +517,10 @@ test:do_execsql_test(
         DROP TABLE t1;
         DROP TABLE t2;
 
-        CREATE TABLE t1(x primary key, y BLOB);    -- affinity of t1.y is NONE
+        CREATE TABLE t1(x  INT primary key, y BLOB);    -- affinity of t1.y is NONE
         INSERT INTO t1 VALUES(1,'99');
 
-        CREATE TABLE t2(a primary key, b REAL);  -- affinity of t2.b is REAL
+        CREATE TABLE t2(a  INT primary key, b FLOAT);  -- affinity of t2.b is REAL
         CREATE INDEX t2b ON t2(b);
         INSERT INTO t2 VALUES(2,99.0);
 
@@ -618,10 +617,10 @@ test:do_execsql_test(
         DROP TABLE t1;
         DROP TABLE t2;
 
-        CREATE TABLE t1(x primary key, y NUMERIC);  -- affinity of t1.y is NUMERIC
+        CREATE TABLE t1(x  INT primary key, y NUMERIC);  -- affinity of t1.y is NUMERIC
         INSERT INTO t1 VALUES(1,99);
 
-        CREATE TABLE t2(a primary key, b BLOB);  -- affinity of t2.b is NONE
+        CREATE TABLE t2(a  INT primary key, b BLOB);  -- affinity of t2.b is NONE
         CREATE INDEX t2b ON t2(b);
         INSERT INTO t2 VALUES(2,'99');
 
@@ -718,10 +717,10 @@ test:do_execsql_test(
         DROP TABLE t1;
         DROP TABLE t2;
 
-        CREATE TABLE t1(x primary key, y INT);  -- affinity of t1.y is INTEGER
+        CREATE TABLE t1(x  INT primary key, y INT);  -- affinity of t1.y is INTEGER
         INSERT INTO t1 VALUES(1,99);
 
-        CREATE TABLE t2(a primary key, b BLOB);  -- affinity of t2.b is NONE
+        CREATE TABLE t2(a  INT primary key, b BLOB);  -- affinity of t2.b is NONE
         CREATE INDEX t2b ON t2(b);
         INSERT INTO t2 VALUES(2,'99');
 
@@ -818,10 +817,10 @@ test:do_execsql_test(
         DROP TABLE t1;
         DROP TABLE t2;
 
-        CREATE TABLE t1(x primary key, y REAL);  -- affinity of t1.y is REAL
+        CREATE TABLE t1(x  INT primary key, y FLOAT);  -- affinity of t1.y is REAL
         INSERT INTO t1 VALUES(1,99.0);
 
-        CREATE TABLE t2(a primary key, b BLOB);  -- affinity of t2.b is NONE
+        CREATE TABLE t2(a  INT primary key, b BLOB);  -- affinity of t2.b is NONE
         CREATE INDEX t2b ON t2(b);
         INSERT INTO t2 VALUES(2,'99');
 
diff --git a/test/sql-tap/whereC.test.lua b/test/sql-tap/whereC.test.lua
index e7154c5e6..89459dee3 100755
--- a/test/sql-tap/whereC.test.lua
+++ b/test/sql-tap/whereC.test.lua
@@ -21,7 +21,7 @@ testprefix = "whereC"
 test:do_execsql_test(
     1.0,
     [[
-        CREATE TABLE t1(i INTEGER PRIMARY KEY, a, b INTEGER);
+        CREATE TABLE t1(i INTEGER PRIMARY KEY, a INT, b INTEGER);
 
         INSERT INTO t1 VALUES(1, 1, 1);
         INSERT INTO t1 VALUES(2, 1, 1);
diff --git a/test/sql-tap/whereD.test.lua b/test/sql-tap/whereD.test.lua
index 15e6fb284..6ba90dc6d 100755
--- a/test/sql-tap/whereD.test.lua
+++ b/test/sql-tap/whereD.test.lua
@@ -23,7 +23,7 @@ testprefix = "whereD"
 test:do_execsql_test(
     1.1,
     [[
-        CREATE TABLE t(i int PRIMARY key,j int,k,m,n);
+        CREATE TABLE t(i int PRIMARY key,j int,k TEXT, m INT, n TEXT);
         CREATE INDEX ijk ON t(i,j,k);
         CREATE INDEX jmn ON t(j,m,n);
 
@@ -186,11 +186,11 @@ test:do_execsql_test(
 test:do_execsql_test(
     2.0,
     [[
-        CREATE TABLE t1(a PRIMARY KEY,b,c,d);
+        CREATE TABLE t1(a  INT PRIMARY KEY,b INT ,c INT ,d INT );
         CREATE INDEX t1b ON t1(b);
         CREATE INDEX t1c ON t1(c);
         CREATE INDEX t1d ON t1(d);
-        CREATE TABLE t2(x PRIMARY KEY,y);
+        CREATE TABLE t2(x  INT PRIMARY KEY,y INT );
         CREATE INDEX t2y ON t2(y);
 
         INSERT INTO t1 VALUES(1,2,3,4);
@@ -247,7 +247,7 @@ end
 test:do_execsql_test(
     3.0,
     [[
-        CREATE TABLE t3(a PRIMARY KEY, b, c);
+        CREATE TABLE t3(a  INT PRIMARY KEY, b TEXT, c TEXT);
         CREATE UNIQUE INDEX i3 ON t3(a, b);
         INSERT INTO t3 VALUES(1, 'one', 'i');
         INSERT INTO t3 VALUES(3, 'three', 'iii');
@@ -256,7 +256,7 @@ test:do_execsql_test(
         INSERT INTO t3 VALUES(4, 'four', 'iv');
         INSERT INTO t3 VALUES(5, 'five', 'v');
 
-        CREATE TABLE t4(x PRIMARY KEY, y);
+        CREATE TABLE t4(x  TEXT PRIMARY KEY, y TEXT);
         INSERT INTO t4 VALUES('a', 'one');
         INSERT INTO t4 VALUES('b', 'two');
     ]])
@@ -307,9 +307,9 @@ test:do_test(
     4.1,
     function()
         return test:execsql [[
-            CREATE TABLE t41(a PRIMARY KEY,b,c);
+            CREATE TABLE t41(a  INT PRIMARY KEY,b INT ,c INT );
             INSERT INTO t41 VALUES(1,2,3), (4,5,6);
-            CREATE TABLE t42(d PRIMARY KEY,e,f);
+            CREATE TABLE t42(d  INT PRIMARY KEY,e INT ,f INT );
             INSERT INTO t42 VALUES(3,6,9), (4,8,12);
             SELECT * FROM t41 AS x LEFT JOIN t42 AS y ON (y.d=x.c) OR (y.e=x.b);
         ]]
@@ -408,7 +408,7 @@ test:do_execsql_test(
     5.1,
     [[
         DROP TABLE IF EXISTS t;
-        CREATE TABLE t(c0 PRIMARY key,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17);
+        CREATE TABLE t(c0  INT PRIMARY key,c1 INT ,c2 INT ,c3 INT ,c4 INT ,c5 INT ,c6 INT ,c7 INT ,c8 INT ,c9 INT ,c10 INT ,c11 INT ,c12 INT ,c13 INT ,c14 INT ,c15 INT ,c16 INT ,c17 INT );
         CREATE INDEX tc1 ON t(c1);
         CREATE INDEX tc2 ON t(c2);
         CREATE INDEX tc3 ON t(c3);
diff --git a/test/sql-tap/whereF.test.lua b/test/sql-tap/whereF.test.lua
index cd2cbde34..5a894b748 100755
--- a/test/sql-tap/whereF.test.lua
+++ b/test/sql-tap/whereF.test.lua
@@ -52,8 +52,8 @@ testprefix = "whereF"
 test:do_execsql_test(
     1.0,
     [[
-        CREATE TABLE t1(a PRIMARY KEY, b, c);
-        CREATE TABLE t2(d PRIMARY KEY, e, f);
+        CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT);
+        CREATE TABLE t2(d INT PRIMARY KEY, e INT, f INT);
     ]], {
         -- <1.0>
         
@@ -78,8 +78,8 @@ test:do_execsql_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a PRIMARY KEY, b, c);
-        CREATE TABLE t2(d PRIMARY KEY, e, f);
+        CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT);
+        CREATE TABLE t2(d INT PRIMARY KEY, e INT, f INT);
 
         CREATE UNIQUE INDEX i2 ON t1(b);
     ]], {
@@ -107,8 +107,8 @@ test:do_execsql_test(
     [[
         DROP TABLE t1;
         DROP TABLE t2;
-        CREATE TABLE t1(a, b, c, PRIMARY KEY(a,b));
-        CREATE TABLE t2(d PRIMARY KEY, e, f);
+        CREATE TABLE t1(a INT, b INT, c INT, PRIMARY KEY(a,b));
+        CREATE TABLE t2(d INT PRIMARY KEY, e INT, f INT);
     ]], {
         -- <3.0>
         
@@ -145,7 +145,7 @@ test:do_test(
 test:do_execsql_test(
     4.0,
     [[
-        CREATE TABLE t4(a,b,c,d,e, PRIMARY KEY(a,b,c));
+        CREATE TABLE t4(a INT,b INT,c INT,d INT,e INT, PRIMARY KEY(a,b,c));
         CREATE INDEX t4adc ON t4(a,d,c);
         CREATE UNIQUE INDEX t4aebc ON t4(a,e,b,c);
         EXPLAIN QUERY PLAN SELECT a FROM t4 WHERE a=? AND b=?;
diff --git a/test/sql-tap/whereG.test.lua b/test/sql-tap/whereG.test.lua
index ded983975..586ddd7d2 100755
--- a/test/sql-tap/whereG.test.lua
+++ b/test/sql-tap/whereG.test.lua
@@ -23,11 +23,11 @@ test:do_execsql_test(
     "whereG-1.0",
     [[
         CREATE TABLE composer(
-          cid PRIMARY KEY,
+          cid INT PRIMARY KEY,
           cname TEXT
         );
         CREATE TABLE album(
-          aid PRIMARY KEY,
+          aid INT PRIMARY KEY,
           aname TEXT
         );
         CREATE TABLE track(
@@ -230,8 +230,8 @@ test:do_catchsql_test(
 test:do_execsql_test(
     "whereG-3.0",
     [[
-        CREATE TABLE a(a1 PRIMARY KEY, a2);
-        CREATE TABLE b(b1 PRIMARY KEY, b2);
+        CREATE TABLE a(a1  INT PRIMARY KEY, a2 INT );
+        CREATE TABLE b(b1  INT PRIMARY KEY, b2 INT );
     ]], {
         -- <whereG-3.0>
         
@@ -257,7 +257,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "whereG-4.0",
     [[
-        CREATE TABLE t4(x PRIMARY key);
+        CREATE TABLE t4(x TEXT PRIMARY key);
         INSERT INTO t4 VALUES('right'),('wrong');
         SELECT DISTINCT x
          FROM (SELECT x FROM t4 GROUP BY x)
@@ -281,7 +281,7 @@ test:do_execsql_test(
     5.1,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a, b, c, PRIMARY KEY (a,b));
+        CREATE TABLE t1(a INT , b INT , c INT , PRIMARY KEY (a,b));
     ]])
 
 -- do_eqp_test 5.1.2 {
@@ -326,10 +326,10 @@ test:do_execsql_test(
     6.0,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(i int PRIMARY KEY, x, y, z);
+        CREATE TABLE t1(i int PRIMARY KEY, x INT , y INT , z INT );
         INSERT INTO t1 VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4);
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t2(i int PRIMARY KEY, bool char);
+        CREATE TABLE t2(i int PRIMARY KEY, bool TEXT);
         INSERT INTO t2 VALUES(1,'T'), (2,'F');
         SELECT count(*) FROM t1 LEFT JOIN t2 ON t1.i=t2.i AND bool='T' union all
         SELECT count(*) FROM t1 LEFT JOIN t2 ON likely(t1.i=t2.i) AND bool='T';
@@ -346,10 +346,10 @@ test:do_execsql_test(
     7.0,
     [[
         DROP TABLE IF EXISTS t1;
-        CREATE TABLE t1(a, b, PRIMARY KEY(a,b));
+        CREATE TABLE t1(a INT , b INT , PRIMARY KEY(a,b));
         INSERT INTO t1 VALUES(9,1),(1,2);
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t2(x, y, PRIMARY KEY(x,y));
+        CREATE TABLE t2(x INT , y INT , PRIMARY KEY(x,y));
         INSERT INTO t2 VALUES(3,3),(4,4);
         SELECT likely(a), x FROM t1, t2 ORDER BY 1, 2;
     ]], {
diff --git a/test/sql-tap/whereI.test.lua b/test/sql-tap/whereI.test.lua
index 5f041c2bf..3ae5b82f2 100755
--- a/test/sql-tap/whereI.test.lua
+++ b/test/sql-tap/whereI.test.lua
@@ -22,7 +22,7 @@ test:plan(7)
 -- ["source",[["testdir"],"\/tester.tcl"]]
 testprefix = "whereI"
 test:do_execsql_test(1.0, [[
-    CREATE TABLE t1(a, b, c, PRIMARY KEY(a));
+    CREATE TABLE t1(a INT, b TEXT, c TEXT, PRIMARY KEY(a));
     INSERT INTO t1 VALUES(1, 'a', 'z');
     INSERT INTO t1 VALUES(2, 'b', 'y');
     INSERT INTO t1 VALUES(3, 'c', 'x');
@@ -57,7 +57,7 @@ test:do_execsql_test(1.3, [[
 -- Try that again, this time with non integer PRIMARY KEY values.
 --
 test:do_execsql_test(2.0, [[
-    CREATE TABLE t2(a, b, c, PRIMARY KEY(a));
+    CREATE TABLE t2(a TEXT, b TEXT, c TEXT, PRIMARY KEY(a));
     INSERT INTO t2 VALUES('i', 'a', 'z');
     INSERT INTO t2 VALUES('ii', 'b', 'y');
     INSERT INTO t2 VALUES('iii', 'c', 'x');
@@ -92,7 +92,7 @@ test:do_execsql_test(2.3, [[
 -- On a table with a multi-column PK.
 --
 test:do_execsql_test(3.0, [[
-    CREATE TABLE t3(a, b, c, d, PRIMARY KEY(c, b));
+    CREATE TABLE t3(a TEXT, b INT, c INT, d TEXT, PRIMARY KEY(c, b));
 
     INSERT INTO t3 VALUES('f', 1, 1, 'o');
     INSERT INTO t3 VALUES('o', 2, 1, 't');
@@ -102,7 +102,7 @@ test:do_execsql_test(3.0, [[
     CREATE INDEX t3i1 ON t3(d);
     CREATE INDEX t3i2 ON t3(a);
 
-    SELECT c||'.'||b FROM t3 WHERE a='t' OR d='t'
+    SELECT CAST(c AS TEXT)||'.'||CAST(b AS TEXT) FROM t3 WHERE a='t' OR d='t'
 ]], {
     -- <3.0>
     '2.1', '2.2', '1.2'
diff --git a/test/sql-tap/whereK.test.lua b/test/sql-tap/whereK.test.lua
index 2a9e778ec..3c27099c0 100755
--- a/test/sql-tap/whereK.test.lua
+++ b/test/sql-tap/whereK.test.lua
@@ -25,7 +25,7 @@ test:plan(10)
 -- ["source",[["testdir"],"\/tester.tcl"]]
 testprefix = "whereK"
 test:do_execsql_test(1.1, [[
-  CREATE TABLE t1(a,b,c, primary key (a,b,c));
+  CREATE TABLE t1(a INT ,b INT ,c INT , primary key (a,b,c));
   WITH RECURSIVE c(x) AS (VALUES(0) UNION ALL SELECT x+1 FROM c WHERE x<99)
     INSERT INTO t1(a,b,c) SELECT x, x/10, x%10 FROM c;
   CREATE INDEX t1bc ON t1(b,c);
diff --git a/test/sql-tap/with1.test.lua b/test/sql-tap/with1.test.lua
index c6a895875..faa99811c 100755
--- a/test/sql-tap/with1.test.lua
+++ b/test/sql-tap/with1.test.lua
@@ -68,7 +68,7 @@ test:do_execsql_test(1.4, [[
 ----------------------------------------------------------------------------
 test:do_execsql_test(2.1, [[
   DROP TABLE IF EXISTS t1;
-  CREATE TABLE t1(x PRIMARY KEY);
+  CREATE TABLE t1(x INT PRIMARY KEY);
   INSERT INTO t1 VALUES(1);
   INSERT INTO t1 VALUES(2);
   WITH tmp AS ( SELECT * FROM t1 ) SELECT x FROM tmp;
@@ -139,8 +139,8 @@ test:do_catchsql_test(3.2, [[
 })
 
 test:do_execsql_test(3.3, [[
-  CREATE TABLE t3(x PRIMARY KEY);
-  CREATE TABLE t4(x PRIMARY KEY);
+  CREATE TABLE t3(x TEXT PRIMARY KEY);
+  CREATE TABLE t4(x TEXT PRIMARY KEY);
 
   INSERT INTO t3 VALUES('T3');
   INSERT INTO t4 VALUES('T4');
@@ -185,7 +185,7 @@ test:do_catchsql_test(3.6, [[
 ---------------------------------------------------------------------------
 test:do_execsql_test(4.1, [[
   DROP TABLE IF EXISTS t1;
-  CREATE TABLE t1(x PRIMARY KEY);
+  CREATE TABLE t1(x INT PRIMARY KEY);
   INSERT INTO t1 VALUES(1);
   INSERT INTO t1 VALUES(2);
   INSERT INTO t1 VALUES(3);
@@ -241,7 +241,7 @@ test:do_catchsql_test(5.2, [[
 })
 
 test:do_execsql_test("5.2.1", [[
-  CREATE TABLE edge(xfrom, xto, seq, PRIMARY KEY(xfrom, xto));
+  CREATE TABLE edge(xfrom INT, xto INT, seq INT, PRIMARY KEY(xfrom, xto));
   INSERT INTO edge VALUES(0, 1, 10);
   INSERT INTO edge VALUES(1, 2, 20);
   INSERT INTO edge VALUES(0, 3, 30);
@@ -348,7 +348,7 @@ test:do_catchsql_test("5.6.2", [[
 })
 
 test:do_catchsql_test("5.6.3", [[
-  CREATE TABLE t5(a PRIMARY KEY, b);
+  CREATE TABLE t5(a  INT PRIMARY KEY, b INT );
   WITH i(x) AS ( SELECT * FROM t5 )
   SELECT * FROM i;
 ]], {
@@ -397,7 +397,7 @@ test:do_catchsql_test("5.6.7", [[
 --
 test:do_execsql_test(6.1, [[
   CREATE TABLE f(
-      id PRIMARY KEY, parentid REFERENCES f, name TEXT
+      id INTEGER PRIMARY KEY, parentid  INT REFERENCES f, name TEXT
   );
 
   INSERT INTO f VALUES(0, NULL, '');
@@ -458,7 +458,7 @@ test:do_execsql_test(6.4, [[
 
 ---------------------------------------------------------------------------
 test:do_execsql_test(7.1, [[
-  CREATE TABLE tree(i PRIMARY KEY, p);
+  CREATE TABLE tree(i  INT PRIMARY KEY, p INT );
   INSERT INTO tree VALUES(1, NULL);
   INSERT INTO tree VALUES(2, 1);
   INSERT INTO tree VALUES(3, 1);
@@ -470,7 +470,7 @@ test:do_execsql_test(7.2, [[
   WITH t(id, path) AS (
     SELECT i, '' FROM tree WHERE p IS NULL
     UNION ALL
-    SELECT i, path || '/' || i FROM tree, t WHERE p = id
+    SELECT i, path || '/' || CAST(i as TEXT) FROM tree, t WHERE p = id
   ) 
   SELECT path FROM t;
 ]], {
@@ -670,7 +670,7 @@ limit_test(9.9, -1, -1)
 -- #
 -- do_execsql_test 10.1 {
 --   DROP TABLE IF EXISTS tree;
---   CREATE TABLE tree(id INTEGER PRIMARY KEY, parentid, payload);
+--   CREATE TABLE tree(id INTEGER PRIMARY KEY, parentid INT , payload INT );
 -- }
 -- proc insert_into_tree {L} {
 --   db eval { DELETE FROM tree }
@@ -864,7 +864,7 @@ test:do_execsql_test("10.7.3", [[
 --   /a/b /a/C /a/d /B/e /B/F /B/g /c/h /c/I /c/j
 -- }
 test:do_execsql_test("10.8.4.1", [[
-  CREATE TABLE tst(a PRIMARY KEY,b);
+  CREATE TABLE tst(a  TEXT PRIMARY KEY,b TEXT );
   INSERT INTO tst VALUES('a', 'A');
   INSERT INTO tst VALUES('b', 'B');
   INSERT INTO tst VALUES('c', 'C');
diff --git a/test/sql-tap/with2.test.lua b/test/sql-tap/with2.test.lua
index 19051640c..3fd91b62f 100755
--- a/test/sql-tap/with2.test.lua
+++ b/test/sql-tap/with2.test.lua
@@ -23,7 +23,7 @@ testprefix = "with2"
 test:do_execsql_test(
     1.0,
     [[
-        CREATE TABLE t1(a PRIMARY KEY);
+        CREATE TABLE t1(a  INT PRIMARY KEY);
         INSERT INTO t1 VALUES(1);
         INSERT INTO t1 VALUES(2);
     ]])
@@ -64,7 +64,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     1.4,
     [[
-        CREATE TABLE t2(i PRIMARY KEY);
+        CREATE TABLE t2(i  INT PRIMARY KEY);
         INSERT INTO t2 VALUES(2);
         INSERT INTO t2 VALUES(3);
         INSERT INTO t2 VALUES(5);
@@ -98,8 +98,8 @@ test:do_execsql_test(
     [[
         --CREATE TABLE t3 AS SELECT 3 AS x;
         --CREATE TABLE t4 AS SELECT 4 AS x;
-        CREATE TABLE t3(x PRIMARY KEY); INSERT INTO t3 VALUES(3);
-        CREATE TABLE t4(x PRIMARY KEY); INSERT INTO t4 VALUES(4);
+        CREATE TABLE t3(x  INT PRIMARY KEY); INSERT INTO t3 VALUES(3);
+        CREATE TABLE t4(x  INT PRIMARY KEY); INSERT INTO t4 VALUES(4);
 
         WITH x1 AS (SELECT * FROM t3),
              x2 AS (
@@ -409,8 +409,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t1(a PRIMARY KEY, b);
-        CREATE TABLE t2(a PRIMARY KEY, b);
+        CREATE TABLE t1(a INT PRIMARY KEY, b INT);
+        CREATE TABLE t2(a INT PRIMARY KEY, b INT);
         INSERT INTO t2 VALUES (1, 1), (2, 2);
     ]], {
         -- <5.1>
@@ -510,8 +510,8 @@ test:do_execsql_test(
     [[
         DROP TABLE IF EXISTS t1;
         DROP TABLE IF EXISTS t2;
-        CREATE TABLE t1(a PRIMARY KEY, b);
-        CREATE TABLE t2(a PRIMARY KEY, b);
+        CREATE TABLE t1(a  INT PRIMARY KEY, b INT );
+        CREATE TABLE t2(a  INT PRIMARY KEY, b INT );
     ]])
 
 test:do_catchsql_test(6.2, [[
@@ -674,7 +674,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     8.1,
     [[
-        CREATE TABLE t7(id PRIMARY KEY, y);
+        CREATE TABLE t7(id  INT PRIMARY KEY, y INT );
         INSERT INTO t7 VALUES(1, NULL);
         CREATE VIEW v AS SELECT y FROM t7 ORDER BY y;
     ]])
diff --git a/test/sql/check-clear-ephemeral.result b/test/sql/check-clear-ephemeral.result
index 4ab1fe14c..cfc0f4f75 100644
--- a/test/sql/check-clear-ephemeral.result
+++ b/test/sql/check-clear-ephemeral.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE t1(a,b,c,PRIMARY KEY(b,c));")
+box.sql.execute("CREATE TABLE t1(a INT,b INT,c INT,PRIMARY KEY(b,c));")
 ---
 ...
 -- Debug
diff --git a/test/sql/check-clear-ephemeral.test.lua b/test/sql/check-clear-ephemeral.test.lua
index c7ea7333d..77dae5112 100644
--- a/test/sql/check-clear-ephemeral.test.lua
+++ b/test/sql/check-clear-ephemeral.test.lua
@@ -4,7 +4,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE t1(a,b,c,PRIMARY KEY(b,c));")
+box.sql.execute("CREATE TABLE t1(a INT,b INT,c INT,PRIMARY KEY(b,c));")
 
 -- Debug
 -- box.sql.execute("PRAGMA vdbe_debug=ON ; INSERT INTO zoobar VALUES (111, 222, 'c3', 444)")
diff --git a/test/sql/clear.result b/test/sql/clear.result
index c75e1343c..9d4e9d386 100644
--- a/test/sql/clear.result
+++ b/test/sql/clear.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE zoobar (c1, c2 PRIMARY KEY, c3, c4)")
+box.sql.execute("CREATE TABLE zoobar (c1 INT, c2 INT PRIMARY KEY, c3 TEXT, c4 INT)")
 ---
 ...
 box.sql.execute("CREATE UNIQUE INDEX zoobar2 ON zoobar(c1, c4)")
diff --git a/test/sql/clear.test.lua b/test/sql/clear.test.lua
index 142cda812..78923f157 100644
--- a/test/sql/clear.test.lua
+++ b/test/sql/clear.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE zoobar (c1, c2 PRIMARY KEY, c3, c4)")
+box.sql.execute("CREATE TABLE zoobar (c1 INT, c2 INT PRIMARY KEY, c3 TEXT, c4 INT)")
 box.sql.execute("CREATE UNIQUE INDEX zoobar2 ON zoobar(c1, c4)")
 
 -- Debug
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 79ba9abc0..419e469f7 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -34,7 +34,7 @@ box.sql.execute("SELECT 1 LIMIT 1 COLLATE BINARY, 1;")
 ...
 -- gh-3052: upper/lower support only default locale
 -- For tr-TR result depends on collation
-box.sql.execute([[CREATE TABLE tu (descriptor CHAR(50) PRIMARY KEY, letter CHAR)]]);
+box.sql.execute([[CREATE TABLE tu (descriptor CHAR(50) PRIMARY KEY, letter CHAR(50))]]);
 ---
 ...
 box.internal.collation.create('TURKISH', 'ICU', 'tr-TR', {strength='primary'});
diff --git a/test/sql/collation.test.lua b/test/sql/collation.test.lua
index 935dea824..da577c910 100644
--- a/test/sql/collation.test.lua
+++ b/test/sql/collation.test.lua
@@ -14,7 +14,7 @@ box.sql.execute("SELECT 1 LIMIT 1 COLLATE BINARY, 1;")
 
 -- gh-3052: upper/lower support only default locale
 -- For tr-TR result depends on collation
-box.sql.execute([[CREATE TABLE tu (descriptor CHAR(50) PRIMARY KEY, letter CHAR)]]);
+box.sql.execute([[CREATE TABLE tu (descriptor CHAR(50) PRIMARY KEY, letter CHAR(50))]]);
 box.internal.collation.create('TURKISH', 'ICU', 'tr-TR', {strength='primary'});
 box.sql.execute([[INSERT INTO tu VALUES ('Latin Capital Letter I U+0049','I');]])
 box.sql.execute([[INSERT INTO tu VALUES ('Latin Small Letter I U+0069','i');]])
diff --git a/test/sql/delete-multiple-idx.result b/test/sql/delete-multiple-idx.result
index a163cf153..27c352aaa 100644
--- a/test/sql/delete-multiple-idx.result
+++ b/test/sql/delete-multiple-idx.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- Create space.
-box.sql.execute("CREATE TABLE t3(id primary key,x,y);");
+box.sql.execute("CREATE TABLE t3(id INT primary key,x INT,y INT);");
 ---
 ...
 box.sql.execute("CREATE UNIQUE INDEX t3y ON t3(y);");
diff --git a/test/sql/delete-multiple-idx.test.lua b/test/sql/delete-multiple-idx.test.lua
index e18735585..4ce7f2df3 100644
--- a/test/sql/delete-multiple-idx.test.lua
+++ b/test/sql/delete-multiple-idx.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- Create space.
-box.sql.execute("CREATE TABLE t3(id primary key,x,y);");
+box.sql.execute("CREATE TABLE t3(id INT primary key,x INT,y INT);");
 box.sql.execute("CREATE UNIQUE INDEX t3y ON t3(y);");
 
 -- Debug.
diff --git a/test/sql/delete.result b/test/sql/delete.result
index 993e9e04d..907143409 100644
--- a/test/sql/delete.result
+++ b/test/sql/delete.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE t1(a, b, PRIMARY KEY(a, b));");
+box.sql.execute("CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a, b));");
 ---
 ...
 -- Debug
@@ -67,7 +67,7 @@ box.sql.execute("TRUNCATE TABLE \"_sql_stat1\";")
 ---
 - error: Can't truncate a system space, space '_sql_stat1'
 ...
-box.sql.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT, b STR);")
+box.sql.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT, b TEXT);")
 ---
 ...
 box.sql.execute("INSERT INTO t1 VALUES(1, 1, 'one');")
diff --git a/test/sql/delete.test.lua b/test/sql/delete.test.lua
index 0477d227c..5a0813071 100644
--- a/test/sql/delete.test.lua
+++ b/test/sql/delete.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE t1(a, b, PRIMARY KEY(a, b));");
+box.sql.execute("CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a, b));");
 
 -- Debug
 -- box.sql.execute("PRAGMA vdbe_debug=ON ; INSERT INTO zoobar VALUES (111, 222, 'c3', 444)")
@@ -46,7 +46,7 @@ box.sql.execute("DROP TABLE t2;")
 -- can't truncate system table.
 box.sql.execute("TRUNCATE TABLE \"_sql_stat1\";")
 
-box.sql.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT, b STR);")
+box.sql.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT, b TEXT);")
 box.sql.execute("INSERT INTO t1 VALUES(1, 1, 'one');")
 box.sql.execute("INSERT INTO t1 VALUES(2, 2, 'two');")
 
diff --git a/test/sql/drop-index.result b/test/sql/drop-index.result
index 2aaddac28..8cd667bec 100644
--- a/test/sql/drop-index.result
+++ b/test/sql/drop-index.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE zzoobar (c1, c2 PRIMARY KEY, c3, c4)")
+box.sql.execute("CREATE TABLE zzoobar (c1 NUM, c2 INT PRIMARY KEY, c3 TEXT, c4 NUM)")
 ---
 ...
 box.sql.execute("CREATE UNIQUE INDEX zoobar2 ON zzoobar(c1, c4)")
diff --git a/test/sql/drop-index.test.lua b/test/sql/drop-index.test.lua
index 8bb51e157..4fa7b9867 100644
--- a/test/sql/drop-index.test.lua
+++ b/test/sql/drop-index.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE zzoobar (c1, c2 PRIMARY KEY, c3, c4)")
+box.sql.execute("CREATE TABLE zzoobar (c1 NUM, c2 INT PRIMARY KEY, c3 TEXT, c4 NUM)")
 
 box.sql.execute("CREATE UNIQUE INDEX zoobar2 ON zzoobar(c1, c4)")
 box.sql.execute("CREATE        INDEX zoobar3 ON zzoobar(c3)")
diff --git a/test/sql/drop-table.result b/test/sql/drop-table.result
index 08f249668..43e9dea9f 100644
--- a/test/sql/drop-table.result
+++ b/test/sql/drop-table.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE zzzoobar (c1, c2 PRIMARY KEY, c3, c4)")
+box.sql.execute("CREATE TABLE zzzoobar (c1 INT, c2 INT PRIMARY KEY, c3 TEXT, c4 INT)")
 ---
 ...
 -- Debug
diff --git a/test/sql/drop-table.test.lua b/test/sql/drop-table.test.lua
index 9663074df..95043cdf5 100644
--- a/test/sql/drop-table.test.lua
+++ b/test/sql/drop-table.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE zzzoobar (c1, c2 PRIMARY KEY, c3, c4)")
+box.sql.execute("CREATE TABLE zzzoobar (c1 INT, c2 INT PRIMARY KEY, c3 TEXT, c4 INT)")
 
 -- Debug
 -- box.sql.execute("PRAGMA vdbe_debug=ON ; INSERT INTO zzzoobar VALUES (111, 222, 'c3', 444)")
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index a0ba60f45..2bcfdb7db 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -16,7 +16,7 @@ errinj = box.error.injection
 fiber = require('fiber')
 ---
 ...
-box.sql.execute('create table test (id primary key, a float, b text)')
+box.sql.execute('create table test (id int primary key, a float, b text)')
 ---
 ...
 box.schema.user.grant('guest','read,write,execute', 'universe')
@@ -202,7 +202,7 @@ box.sql.execute("DROP TABLE t2;")
 -- Tests which are aimed at verifying work of commit/rollback
 -- triggers on _fk_constraint space.
 --
-box.sql.execute("CREATE TABLE t3 (id PRIMARY KEY, a REFERENCES t3, b INT UNIQUE);")
+box.sql.execute("CREATE TABLE t3 (id NUMERIC PRIMARY KEY, a INT REFERENCES t3, b INT UNIQUE);")
 ---
 ...
 t = box.space._fk_constraint:select{}[1]:totable()
diff --git a/test/sql/errinj.test.lua b/test/sql/errinj.test.lua
index 25d73f0c2..fa7f9f2d6 100644
--- a/test/sql/errinj.test.lua
+++ b/test/sql/errinj.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 errinj = box.error.injection
 fiber = require('fiber')
 
-box.sql.execute('create table test (id primary key, a float, b text)')
+box.sql.execute('create table test (id int primary key, a float, b text)')
 box.schema.user.grant('guest','read,write,execute', 'universe')
 cn = remote.connect(box.cfg.listen)
 cn:ping()
@@ -75,7 +75,7 @@ box.sql.execute("DROP TABLE t2;")
 -- Tests which are aimed at verifying work of commit/rollback
 -- triggers on _fk_constraint space.
 --
-box.sql.execute("CREATE TABLE t3 (id PRIMARY KEY, a REFERENCES t3, b INT UNIQUE);")
+box.sql.execute("CREATE TABLE t3 (id NUMERIC PRIMARY KEY, a INT REFERENCES t3, b INT UNIQUE);")
 t = box.space._fk_constraint:select{}[1]:totable()
 errinj = box.error.injection
 errinj.set("ERRINJ_WAL_IO", true)
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f33b49a03..b6d23a554 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -149,13 +149,8 @@ box.space._fk_constraint:insert(t)
 -- Temporary, in SQL all fields except for INTEGER PRIMARY KEY
 -- are scalar.
 --
-t = {'fk_1', child_id, parent_id, false, 'simple', 'restrict', 'restrict', {1}, {0}}
----
-...
-box.space._fk_constraint:insert(t)
----
-- error: 'Failed to create foreign key constraint ''fk_1'': field type mismatch'
-...
+--t = {'fk_1', child_id, parent_id, false, 'simple', 'restrict', 'restrict', {1}, {0}}
+--box.space._fk_constraint:insert(t)
 -- Each referenced column must appear once.
 --
 t = {'fk_1', child_id, parent_id, false, 'simple', 'restrict', 'restrict', {0, 1}, {1, 1}}
diff --git a/test/sql/foreign-keys.test.lua b/test/sql/foreign-keys.test.lua
index 8d27aa00e..677f3b1f4 100644
--- a/test/sql/foreign-keys.test.lua
+++ b/test/sql/foreign-keys.test.lua
@@ -68,8 +68,8 @@ box.space._fk_constraint:insert(t)
 -- Temporary, in SQL all fields except for INTEGER PRIMARY KEY
 -- are scalar.
 --
-t = {'fk_1', child_id, parent_id, false, 'simple', 'restrict', 'restrict', {1}, {0}}
-box.space._fk_constraint:insert(t)
+--t = {'fk_1', child_id, parent_id, false, 'simple', 'restrict', 'restrict', {1}, {0}}
+--box.space._fk_constraint:insert(t)
 
 -- Each referenced column must appear once.
 --
diff --git a/test/sql/gh-2929-primary-key.result b/test/sql/gh-2929-primary-key.result
index 66a9b96e3..5d95d4182 100644
--- a/test/sql/gh-2929-primary-key.result
+++ b/test/sql/gh-2929-primary-key.result
@@ -13,22 +13,22 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 box.cfg{}
 ---
 ...
-box.sql.execute("CREATE TABLE t1(a INT PRIMARY KEY, b UNIQUE)")
+box.sql.execute("CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE)")
 ---
 ...
-box.sql.execute("CREATE TABLE t2(a UNIQUE, b)")
+box.sql.execute("CREATE TABLE t2(a INT UNIQUE, b INT)")
 ---
 - error: PRIMARY KEY missing on table T2
 ...
-box.sql.execute("CREATE TABLE t3(a)")
+box.sql.execute("CREATE TABLE t3(a NUM)")
 ---
 - error: PRIMARY KEY missing on table T3
 ...
-box.sql.execute("CREATE TABLE t4(a, b)")
+box.sql.execute("CREATE TABLE t4(a DECIMAL, b TEXT)")
 ---
 - error: PRIMARY KEY missing on table T4
 ...
-box.sql.execute("CREATE TABLE t5(a, b UNIQUE)")
+box.sql.execute("CREATE TABLE t5(a DECIMAL, b NUM UNIQUE)")
 ---
 - error: PRIMARY KEY missing on table T5
 ...
diff --git a/test/sql/gh-2929-primary-key.test.lua b/test/sql/gh-2929-primary-key.test.lua
index 0e0535496..a1446b2e5 100644
--- a/test/sql/gh-2929-primary-key.test.lua
+++ b/test/sql/gh-2929-primary-key.test.lua
@@ -8,12 +8,12 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
 box.cfg{}
 
-box.sql.execute("CREATE TABLE t1(a INT PRIMARY KEY, b UNIQUE)")
-box.sql.execute("CREATE TABLE t2(a UNIQUE, b)")
+box.sql.execute("CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE)")
+box.sql.execute("CREATE TABLE t2(a INT UNIQUE, b INT)")
 
-box.sql.execute("CREATE TABLE t3(a)")
-box.sql.execute("CREATE TABLE t4(a, b)")
-box.sql.execute("CREATE TABLE t5(a, b UNIQUE)")
+box.sql.execute("CREATE TABLE t3(a NUM)")
+box.sql.execute("CREATE TABLE t4(a DECIMAL, b TEXT)")
+box.sql.execute("CREATE TABLE t5(a DECIMAL, b NUM UNIQUE)")
 
 box.sql.execute("DROP TABLE t1")
 
diff --git a/test/sql/gh-3199-no-mem-leaks.result b/test/sql/gh-3199-no-mem-leaks.result
index 9d715e8cd..fff6abf92 100644
--- a/test/sql/gh-3199-no-mem-leaks.result
+++ b/test/sql/gh-3199-no-mem-leaks.result
@@ -14,7 +14,7 @@ fiber = require('fiber')
 -- executing SQL queries.
 --
 -- box.cfg()
-box.sql.execute('CREATE TABLE test (id PRIMARY KEY, x INTEGER, y INTEGER)')
+box.sql.execute('CREATE TABLE test (id INT PRIMARY KEY, x INTEGER, y INTEGER)')
 ---
 ...
 box.sql.execute('INSERT INTO test VALUES (1, 1, 1), (2, 2, 2)')
@@ -53,7 +53,7 @@ fiber.info()[fiber.self().id()].memory.used
 ---
 - 0
 ...
-box.sql.execute('CREATE TABLE test2 (id PRIMARY KEY, a TEXT, b INTEGER)')
+box.sql.execute('CREATE TABLE test2 (id INT PRIMARY KEY, a TEXT, b INTEGER)')
 ---
 ...
 box.sql.execute('INSERT INTO test2 VALUES (1, \'abc\', 1), (2, \'hello\', 2)')
@@ -62,12 +62,12 @@ box.sql.execute('INSERT INTO test2 VALUES (1, \'abc\', 1), (2, \'hello\', 2)')
 box.sql.execute('INSERT INTO test2 VALUES (3, \'test\', 3), (4, \'xx\', 4)')
 ---
 ...
-box.sql.execute('SELECT a, id + 2 * a, b FROM test2 WHERE b < id * 2 ORDER BY a ')
+box.sql.execute('SELECT a, id + 2, b FROM test2 WHERE b < id * 2 ORDER BY a ')
 ---
-- - ['abc', 1, 1]
-  - ['hello', 2, 2]
-  - ['test', 3, 3]
-  - ['xx', 4, 4]
+- - ['abc', 3, 1]
+  - ['hello', 4, 2]
+  - ['test', 5, 3]
+  - ['xx', 6, 4]
 ...
 fiber.info()[fiber.self().id()].memory.used
 ---
diff --git a/test/sql/gh-3199-no-mem-leaks.test.lua b/test/sql/gh-3199-no-mem-leaks.test.lua
index 138166bad..1954e34be 100644
--- a/test/sql/gh-3199-no-mem-leaks.test.lua
+++ b/test/sql/gh-3199-no-mem-leaks.test.lua
@@ -10,7 +10,7 @@ fiber = require('fiber')
 -- box.cfg()
 
 
-box.sql.execute('CREATE TABLE test (id PRIMARY KEY, x INTEGER, y INTEGER)')
+box.sql.execute('CREATE TABLE test (id INT PRIMARY KEY, x INTEGER, y INTEGER)')
 box.sql.execute('INSERT INTO test VALUES (1, 1, 1), (2, 2, 2)')
 box.sql.execute('SELECT x, y, x + y FROM test ORDER BY y')
 
@@ -23,10 +23,10 @@ box.sql.execute('SELECT x, y, x + y FROM test ORDER BY y')
 
 fiber.info()[fiber.self().id()].memory.used
 
-box.sql.execute('CREATE TABLE test2 (id PRIMARY KEY, a TEXT, b INTEGER)')
+box.sql.execute('CREATE TABLE test2 (id INT PRIMARY KEY, a TEXT, b INTEGER)')
 box.sql.execute('INSERT INTO test2 VALUES (1, \'abc\', 1), (2, \'hello\', 2)')
 box.sql.execute('INSERT INTO test2 VALUES (3, \'test\', 3), (4, \'xx\', 4)')
-box.sql.execute('SELECT a, id + 2 * a, b FROM test2 WHERE b < id * 2 ORDER BY a ')
+box.sql.execute('SELECT a, id + 2, b FROM test2 WHERE b < id * 2 ORDER BY a ')
 
 fiber.info()[fiber.self().id()].memory.used
 
diff --git a/test/sql/gh2141-delete-trigger-drop-table.result b/test/sql/gh2141-delete-trigger-drop-table.result
index c1b64d11f..82ff51a53 100644
--- a/test/sql/gh2141-delete-trigger-drop-table.result
+++ b/test/sql/gh2141-delete-trigger-drop-table.result
@@ -8,7 +8,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ---
 ...
 -- create space
-box.sql.execute("CREATE TABLE t(id PRIMARY KEY)")
+box.sql.execute("CREATE TABLE t(id INT PRIMARY KEY)")
 ---
 ...
 box.sql.execute("CREATE TRIGGER tt_bu BEFORE UPDATE ON t BEGIN SELECT 1; END")
diff --git a/test/sql/gh2141-delete-trigger-drop-table.test.lua b/test/sql/gh2141-delete-trigger-drop-table.test.lua
index 19d3188a6..be3adc3cc 100644
--- a/test/sql/gh2141-delete-trigger-drop-table.test.lua
+++ b/test/sql/gh2141-delete-trigger-drop-table.test.lua
@@ -3,7 +3,7 @@ engine = test_run:get_cfg('engine')
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
 -- create space
-box.sql.execute("CREATE TABLE t(id PRIMARY KEY)")
+box.sql.execute("CREATE TABLE t(id INT PRIMARY KEY)")
 
 box.sql.execute("CREATE TRIGGER tt_bu BEFORE UPDATE ON t BEGIN SELECT 1; END")
 box.sql.execute("CREATE TRIGGER tt_au AFTER UPDATE ON t BEGIN SELECT 1; END")
diff --git a/test/sql/gh2251-multiple-update.result b/test/sql/gh2251-multiple-update.result
index 5e137eeb6..7066ca99f 100644
--- a/test/sql/gh2251-multiple-update.result
+++ b/test/sql/gh2251-multiple-update.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ---
 ...
 -- box.cfg()
-box.sql.execute("CREATE TABLE t1(a integer primary key, b UNIQUE, e);")
+box.sql.execute("CREATE TABLE t1(a integer primary key, b INT UNIQUE, e INT);")
 ---
 ...
 box.sql.execute("INSERT INTO t1 VALUES(1,4,6);")
@@ -26,7 +26,7 @@ box.sql.execute("SELECT e FROM t1")
 - - [7]
   - [8]
 ...
-box.sql.execute("CREATE TABLE t2(a integer primary key, b UNIQUE, c, d, e,  UNIQUE(c,d));")
+box.sql.execute("CREATE TABLE t2(a integer primary key, b INT UNIQUE, c NUM, d NUM, e INT,  UNIQUE(c,d));")
 ---
 ...
 box.sql.execute("INSERT INTO t2 VALUES(1,2,3,4,5);")
diff --git a/test/sql/gh2251-multiple-update.test.lua b/test/sql/gh2251-multiple-update.test.lua
index 0166a1786..6107125d7 100644
--- a/test/sql/gh2251-multiple-update.test.lua
+++ b/test/sql/gh2251-multiple-update.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
 -- box.cfg()
 
-box.sql.execute("CREATE TABLE t1(a integer primary key, b UNIQUE, e);")
+box.sql.execute("CREATE TABLE t1(a integer primary key, b INT UNIQUE, e INT);")
 box.sql.execute("INSERT INTO t1 VALUES(1,4,6);")
 box.sql.execute("INSERT INTO t1 VALUES(2,5,7);")
 
@@ -13,7 +13,7 @@ box.sql.execute("UPDATE t1 SET e=e+1 WHERE b IN (SELECT b FROM t1);")
 
 box.sql.execute("SELECT e FROM t1")
 
-box.sql.execute("CREATE TABLE t2(a integer primary key, b UNIQUE, c, d, e,  UNIQUE(c,d));")
+box.sql.execute("CREATE TABLE t2(a integer primary key, b INT UNIQUE, c NUM, d NUM, e INT,  UNIQUE(c,d));")
 box.sql.execute("INSERT INTO t2 VALUES(1,2,3,4,5);")
 box.sql.execute("INSERT INTO t2 VALUES(2,3,4,4,6);")
 
diff --git a/test/sql/gh2808-inline-unique-persistency-check.result b/test/sql/gh2808-inline-unique-persistency-check.result
index fdd000f3d..6754af6e7 100644
--- a/test/sql/gh2808-inline-unique-persistency-check.result
+++ b/test/sql/gh2808-inline-unique-persistency-check.result
@@ -12,7 +12,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ---
 ...
 -- Create a table and insert a datum
-box.sql.execute([[CREATE TABLE t1(a PRIMARY KEY, b, UNIQUE(b));]])
+box.sql.execute([[CREATE TABLE t1(a INT PRIMARY KEY, b INT, UNIQUE(b));]])
 ---
 ...
 box.sql.execute([[INSERT INTO t1 VALUES(1,2);]])
diff --git a/test/sql/gh2808-inline-unique-persistency-check.test.lua b/test/sql/gh2808-inline-unique-persistency-check.test.lua
index eb4e051dc..81e2af5e7 100644
--- a/test/sql/gh2808-inline-unique-persistency-check.test.lua
+++ b/test/sql/gh2808-inline-unique-persistency-check.test.lua
@@ -5,7 +5,7 @@ engine = test_run:get_cfg('engine')
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
 -- Create a table and insert a datum
-box.sql.execute([[CREATE TABLE t1(a PRIMARY KEY, b, UNIQUE(b));]])
+box.sql.execute([[CREATE TABLE t1(a INT PRIMARY KEY, b INT, UNIQUE(b));]])
 box.sql.execute([[INSERT INTO t1 VALUES(1,2);]])
 
 -- Sanity check
diff --git a/test/sql/insert-unique.result b/test/sql/insert-unique.result
index 797c8eff5..adfa60ff4 100644
--- a/test/sql/insert-unique.result
+++ b/test/sql/insert-unique.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE zoobar (c1, c2 PRIMARY KEY, c3, c4)")
+box.sql.execute("CREATE TABLE zoobar (c1 INT, c2 INT PRIMARY KEY, c3 TEXT, c4 INT)")
 ---
 ...
 box.sql.execute("CREATE UNIQUE INDEX zoobar2 ON zoobar(c1, c4)")
diff --git a/test/sql/insert-unique.test.lua b/test/sql/insert-unique.test.lua
index a004c57b4..b44a6e247 100644
--- a/test/sql/insert-unique.test.lua
+++ b/test/sql/insert-unique.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE zoobar (c1, c2 PRIMARY KEY, c3, c4)")
+box.sql.execute("CREATE TABLE zoobar (c1 INT, c2 INT PRIMARY KEY, c3 TEXT, c4 INT)")
 box.sql.execute("CREATE UNIQUE INDEX zoobar2 ON zoobar(c1, c4)")
 
 -- Debug
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index af474bcf5..d46df2a26 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -10,7 +10,7 @@ engine = test_run:get_cfg('engine')
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ---
 ...
-box.sql.execute('create table test (id primary key, a float, b text)')
+box.sql.execute('create table test (id int primary key, a float, b text)')
 ---
 ...
 space = box.space.TEST
@@ -328,7 +328,7 @@ cn:execute('select :value', parameters)
 - error: Bind value type MAP for parameter ':value' is not supported
 ...
 -- gh-2608 SQL iproto DDL
-cn:execute('create table test2(id primary key, a, b, c)')
+cn:execute('create table test2(id int primary key, a int, b int, c int)')
 ---
 - rowcount: 1
 ...
@@ -368,7 +368,7 @@ box.space.TEST2
 ...
 -- gh-2617 DDL row_count either 0 or 1.
 -- Test CREATE [IF NOT EXISTS] TABLE.
-cn:execute('create table test3(id primary key, a, b)')
+cn:execute('create table test3(id int primary key, a int, b int)')
 ---
 - rowcount: 1
 ...
@@ -378,7 +378,7 @@ cn:execute('insert into test3 values (1, 1, 1), (2, 2, 2), (3, 3, 3)')
 ---
 - rowcount: 3
 ...
-cn:execute('create table if not exists test3(id primary key)')
+cn:execute('create table if not exists test3(id int primary key)')
 ---
 - rowcount: 0
 ...
diff --git a/test/sql/iproto.test.lua b/test/sql/iproto.test.lua
index 220331b40..e7ab79fa1 100644
--- a/test/sql/iproto.test.lua
+++ b/test/sql/iproto.test.lua
@@ -3,7 +3,7 @@ test_run = require('test_run').new()
 engine = test_run:get_cfg('engine')
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
-box.sql.execute('create table test (id primary key, a float, b text)')
+box.sql.execute('create table test (id int primary key, a float, b text)')
 space = box.space.TEST
 space:replace{1, 2, '3'}
 space:replace{4, 5, '6'}
@@ -115,7 +115,7 @@ parameters[1][':value'] = {kek = 300}
 cn:execute('select :value', parameters)
 
 -- gh-2608 SQL iproto DDL
-cn:execute('create table test2(id primary key, a, b, c)')
+cn:execute('create table test2(id int primary key, a int, b int, c int)')
 box.space.TEST2.name
 cn:execute('insert into test2 values (1, 1, 1, 1)')
 cn:execute('select * from test2')
@@ -127,11 +127,11 @@ box.space.TEST2
 -- gh-2617 DDL row_count either 0 or 1.
 
 -- Test CREATE [IF NOT EXISTS] TABLE.
-cn:execute('create table test3(id primary key, a, b)')
+cn:execute('create table test3(id int primary key, a int, b int)')
 -- Rowcount = 1, although two tuples were created:
 -- for _space and for _index.
 cn:execute('insert into test3 values (1, 1, 1), (2, 2, 2), (3, 3, 3)')
-cn:execute('create table if not exists test3(id primary key)')
+cn:execute('create table if not exists test3(id int primary key)')
 
 -- Test CREATE VIEW [IF NOT EXISTS] and
 --      DROP   VIEW [IF EXISTS].
diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result
index b1076332d..c4b590095 100644
--- a/test/sql/max-on-index.result
+++ b/test/sql/max-on-index.result
@@ -10,7 +10,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 -- create space
 -- scalar affinity
-box.sql.execute("CREATE TABLE test1 (f1, f2 INT, PRIMARY KEY(f1))")
+box.sql.execute("CREATE TABLE test1 (f1 INT, f2 INT, PRIMARY KEY(f1))")
 ---
 ...
 box.sql.execute("CREATE INDEX test1_index ON test1 (f2)")
diff --git a/test/sql/max-on-index.test.lua b/test/sql/max-on-index.test.lua
index b879e388f..7d89c3acd 100644
--- a/test/sql/max-on-index.test.lua
+++ b/test/sql/max-on-index.test.lua
@@ -6,7 +6,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
 -- create space
 -- scalar affinity
-box.sql.execute("CREATE TABLE test1 (f1, f2 INT, PRIMARY KEY(f1))")
+box.sql.execute("CREATE TABLE test1 (f1 INT, f2 INT, PRIMARY KEY(f1))")
 box.sql.execute("CREATE INDEX test1_index ON test1 (f2)")
 
 -- integer affinity
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 93b383a8f..ef104c1c5 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -16,7 +16,7 @@ box.sql.execute('select 1; select 2;')
 ---
 - error: keyword "select" is reserved
 ...
-box.sql.execute('create table t1 (id primary key); select 100;')
+box.sql.execute('create table t1 (id INT primary key); select 100;')
 ---
 - error: keyword "select" is reserved
 ...
diff --git a/test/sql/misc.test.lua b/test/sql/misc.test.lua
index 1ed019874..994e64f3a 100644
--- a/test/sql/misc.test.lua
+++ b/test/sql/misc.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- Forbid multistatement queries.
 box.sql.execute('select 1;')
 box.sql.execute('select 1; select 2;')
-box.sql.execute('create table t1 (id primary key); select 100;')
+box.sql.execute('create table t1 (id INT primary key); select 100;')
 box.space.t1 == nil
 box.sql.execute(';')
 box.sql.execute('')
diff --git a/test/sql/on-conflict.result b/test/sql/on-conflict.result
index 63fe48e79..731f03c66 100644
--- a/test/sql/on-conflict.result
+++ b/test/sql/on-conflict.result
@@ -41,7 +41,7 @@ box.sql.execute("CREATE TABLE t2(a INT PRIMARY KEY ON CONFLICT IGNORE)")
 ...
 -- CHECK constraint is illegal with REPLACE option.
 --
-box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a CHECK (a > 5) ON CONFLICT REPLACE);")
+box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a INTEGER CHECK (a > 5) ON CONFLICT REPLACE);")
 ---
 - error: keyword "ON" is reserved
 ...
@@ -67,7 +67,7 @@ box.sql.execute("CREATE TABLE test (a int, b int NULL, c int, PRIMARY KEY(a, b,
 ...
 -- Several NOT NULL REPLACE constraints work
 --
-box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a NOT NULL ON CONFLICT REPLACE DEFAULT 1, b NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
+box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a INT NOT NULL ON CONFLICT REPLACE DEFAULT 1, b INT NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
 ---
 ...
 box.sql.execute("INSERT INTO a VALUES(1, NULL, NULL);")
diff --git a/test/sql/on-conflict.test.lua b/test/sql/on-conflict.test.lua
index b2d8e0589..aa58b854b 100644
--- a/test/sql/on-conflict.test.lua
+++ b/test/sql/on-conflict.test.lua
@@ -15,7 +15,7 @@ box.sql.execute("CREATE TABLE t2(a INT PRIMARY KEY ON CONFLICT IGNORE)")
 
 -- CHECK constraint is illegal with REPLACE option.
 --
-box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a CHECK (a > 5) ON CONFLICT REPLACE);")
+box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, a INTEGER CHECK (a > 5) ON CONFLICT REPLACE);")
 
 --
 -- gh-3473: Primary key can't be declared with NULL.
@@ -27,7 +27,7 @@ box.sql.execute("CREATE TABLE test (a int, b int NULL, c int, PRIMARY KEY(a, b,
 
 -- Several NOT NULL REPLACE constraints work
 --
-box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a NOT NULL ON CONFLICT REPLACE DEFAULT 1, b NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
+box.sql.execute("CREATE TABLE a (id INT PRIMARY KEY, a INT NOT NULL ON CONFLICT REPLACE DEFAULT 1, b INT NOT NULL ON CONFLICT REPLACE DEFAULT 2);")
 box.sql.execute("INSERT INTO a VALUES(1, NULL, NULL);")
 box.sql.execute("INSERT INTO a VALUES(2, NULL, NULL);")
 box.sql.execute("SELECT * FROM a;")
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index c65baa08e..36a7d555b 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -11,7 +11,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ---
 ...
 -- create space
-box.sql.execute("CREATE TABLE foobar (foo PRIMARY KEY, bar)")
+box.sql.execute("CREATE TABLE foobar (foo INT PRIMARY KEY, bar TEXT)")
 ---
 ...
 -- prepare data
@@ -125,7 +125,7 @@ box.sql.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ...
 -- multi-index
 -- create space
-box.sql.execute("CREATE TABLE barfoo (bar, foo NUM PRIMARY KEY)")
+box.sql.execute("CREATE TABLE barfoo (bar TEXT, foo NUM PRIMARY KEY)")
 ---
 ...
 box.sql.execute("CREATE UNIQUE INDEX barfoo2 ON barfoo(bar)")
@@ -151,7 +151,7 @@ box.sql.execute("SELECT \"name\", \"opts\" FROM \"_trigger\"");
         INTO barfoo VALUES (''trigger test'', 9999); END'}]
 ...
 -- Many entries
-box.sql.execute("CREATE TABLE t1(a,b,c,PRIMARY KEY(b,c));")
+box.sql.execute("CREATE TABLE t1(a INT,b INT,c INT,PRIMARY KEY(b,c));")
 ---
 ...
 box.sql.execute("WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<1000) INSERT INTO t1 SELECT x, x%40, x/40 FROM cnt;")
@@ -180,10 +180,11 @@ box.sql.execute("SELECT \"name\", \"opts\" FROM \"_trigger\"");
 -- ... functional
 box.sql.execute("INSERT INTO foobar VALUES ('foobar trigger test', 8888)")
 ---
+- error: datatype mismatch
 ...
 box.sql.execute("SELECT * FROM barfoo WHERE foo = 9999");
 ---
-- - ['trigger test', 9999]
+- []
 ...
 -- and still persistent
 box.sql.execute("SELECT \"name\", \"opts\" FROM \"_trigger\"")
@@ -215,13 +216,11 @@ box.sql.execute("SELECT * FROM barfoo")
 - - ['foo', 1]
   - ['bar', 2]
   - ['foobar', 1000]
-  - ['trigger test', 9999]
 ...
 box.sql.execute("SELECT * FROM foobar");
 ---
 - - [2, 'bar']
   - [1000, 'foobar']
-  - ['foobar trigger test', 8888]
 ...
 box.sql.execute("SELECT a FROM t1 ORDER BY b, a LIMIT 10 OFFSET 20;");
 ---
diff --git a/test/sql/persistency.test.lua b/test/sql/persistency.test.lua
index 417d8c098..e7b137b44 100644
--- a/test/sql/persistency.test.lua
+++ b/test/sql/persistency.test.lua
@@ -4,7 +4,7 @@ engine = test_run:get_cfg('engine')
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
 -- create space
-box.sql.execute("CREATE TABLE foobar (foo PRIMARY KEY, bar)")
+box.sql.execute("CREATE TABLE foobar (foo INT PRIMARY KEY, bar TEXT)")
 
 -- prepare data
 box.sql.execute("INSERT INTO foobar VALUES (1, 'foo')")
@@ -41,7 +41,7 @@ box.sql.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 -- multi-index
 
 -- create space
-box.sql.execute("CREATE TABLE barfoo (bar, foo NUM PRIMARY KEY)")
+box.sql.execute("CREATE TABLE barfoo (bar TEXT, foo NUM PRIMARY KEY)")
 box.sql.execute("CREATE UNIQUE INDEX barfoo2 ON barfoo(bar)")
 
 -- prepare data
@@ -54,7 +54,7 @@ box.sql.execute("CREATE TRIGGER tfoobar AFTER INSERT ON foobar BEGIN INSERT INTO
 box.sql.execute("SELECT \"name\", \"opts\" FROM \"_trigger\"");
 
 -- Many entries
-box.sql.execute("CREATE TABLE t1(a,b,c,PRIMARY KEY(b,c));")
+box.sql.execute("CREATE TABLE t1(a INT,b INT,c INT,PRIMARY KEY(b,c));")
 box.sql.execute("WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<1000) INSERT INTO t1 SELECT x, x%40, x/40 FROM cnt;")
 box.sql.execute("SELECT a FROM t1 ORDER BY b, a LIMIT 10 OFFSET 20;");
 
diff --git a/test/sql/select-null.result b/test/sql/select-null.result
index 53bef1b50..5ea23d067 100644
--- a/test/sql/select-null.result
+++ b/test/sql/select-null.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE t3(id INT, a, b, PRIMARY KEY(id))")
+box.sql.execute("CREATE TABLE t3(id INT, a text, b TEXT, PRIMARY KEY(id))")
 ---
 ...
 -- Debug
diff --git a/test/sql/select-null.test.lua b/test/sql/select-null.test.lua
index 3e9cb816d..ccbc030c5 100644
--- a/test/sql/select-null.test.lua
+++ b/test/sql/select-null.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE t3(id INT, a, b, PRIMARY KEY(id))")
+box.sql.execute("CREATE TABLE t3(id INT, a text, b TEXT, PRIMARY KEY(id))")
 
 -- Debug
 -- box.sql.execute("PRAGMA vdbe_debug=ON ; INSERT INTO zoobar VALUES (111, 222, 'c3', 444)")
diff --git a/test/sql/sql-statN-index-drop.result b/test/sql/sql-statN-index-drop.result
index a751eca67..760595188 100644
--- a/test/sql/sql-statN-index-drop.result
+++ b/test/sql/sql-statN-index-drop.result
@@ -8,10 +8,10 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ---
 ...
 -- Initializing some things.
-box.sql.execute("CREATE TABLE t1(id PRIMARY KEY, a);")
+box.sql.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT);")
 ---
 ...
-box.sql.execute("CREATE TABLE t2(id PRIMARY KEY, a);")
+box.sql.execute("CREATE TABLE t2(id INT PRIMARY KEY, a INT);")
 ---
 ...
 box.sql.execute("CREATE INDEX i1 ON t1(a);")
@@ -70,10 +70,10 @@ box.sql.execute("DROP TABLE t2;")
 ---
 ...
 -- Same test but dropping an INDEX ON t2.
-box.sql.execute("CREATE TABLE t1(id PRIMARY KEY, a);")
+box.sql.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT);")
 ---
 ...
-box.sql.execute("CREATE TABLE t2(id PRIMARY KEY, a);")
+box.sql.execute("CREATE TABLE t2(id INT PRIMARY KEY, a INT);")
 ---
 ...
 box.sql.execute("CREATE INDEX i1 ON t1(a);")
diff --git a/test/sql/sql-statN-index-drop.test.lua b/test/sql/sql-statN-index-drop.test.lua
index fe7e15b57..35f22910c 100644
--- a/test/sql/sql-statN-index-drop.test.lua
+++ b/test/sql/sql-statN-index-drop.test.lua
@@ -3,8 +3,8 @@ engine = test_run:get_cfg('engine')
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
 -- Initializing some things.
-box.sql.execute("CREATE TABLE t1(id PRIMARY KEY, a);")
-box.sql.execute("CREATE TABLE t2(id PRIMARY KEY, a);")
+box.sql.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT);")
+box.sql.execute("CREATE TABLE t2(id INT PRIMARY KEY, a INT);")
 box.sql.execute("CREATE INDEX i1 ON t1(a);")
 box.sql.execute("CREATE INDEX i1 ON t2(a);")
 box.sql.execute("INSERT INTO t1 VALUES(1, 2);")
@@ -30,8 +30,8 @@ box.sql.execute("DROP TABLE t2;")
 
 -- Same test but dropping an INDEX ON t2.
 
-box.sql.execute("CREATE TABLE t1(id PRIMARY KEY, a);")
-box.sql.execute("CREATE TABLE t2(id PRIMARY KEY, a);")
+box.sql.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT);")
+box.sql.execute("CREATE TABLE t2(id INT PRIMARY KEY, a INT);")
 box.sql.execute("CREATE INDEX i1 ON t1(a);")
 box.sql.execute("CREATE INDEX i1 ON t2(a);")
 box.sql.execute("INSERT INTO t1 VALUES(1, 2);")
diff --git a/test/sql/transition.result b/test/sql/transition.result
index 805e8aa6c..04721596a 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -8,7 +8,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ---
 ...
 -- create space
-box.sql.execute("CREATE TABLE foobar (foo PRIMARY KEY, bar)")
+box.sql.execute("CREATE TABLE foobar (foo INT PRIMARY KEY, bar TEXT)")
 ---
 ...
 -- prepare data
@@ -122,7 +122,7 @@ box.sql.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ...
 -- multi-index
 -- create space
-box.sql.execute("CREATE TABLE barfoo (bar, foo NUM PRIMARY KEY)")
+box.sql.execute("CREATE TABLE barfoo (bar TEXT, foo NUM PRIMARY KEY)")
 ---
 ...
 box.sql.execute("CREATE UNIQUE INDEX barfoo2 ON barfoo(bar)")
@@ -178,17 +178,12 @@ box.sql.execute("DROP TABLE barfoo")
 ---
 ...
 -- attempt to create a table lacking PRIMARY KEY
-box.sql.execute("CREATE TABLE without_rowid_lacking_primary_key(x)")
+box.sql.execute("CREATE TABLE without_rowid_lacking_primary_key(x BLOB)")
 ---
 - error: PRIMARY KEY missing on table WITHOUT_ROWID_LACKING_PRIMARY_KEY
 ...
--- attempt to create a table lacking WITHOUT ROWID clause
-box.sql.execute("CREATE TABLE rowid(x)")
----
-- error: PRIMARY KEY missing on table ROWID
-...
 -- create a table with implicit indices (used to SEGFAULT)
-box.sql.execute("CREATE TABLE implicit_indices(a PRIMARY KEY,b,c,d UNIQUE)")
+box.sql.execute("CREATE TABLE implicit_indices(a INT PRIMARY KEY,b INT,c INT,d TEXT UNIQUE)")
 ---
 ...
 box.sql.execute("DROP TABLE implicit_indices")
diff --git a/test/sql/transition.test.lua b/test/sql/transition.test.lua
index cae45aa17..5a7010d93 100644
--- a/test/sql/transition.test.lua
+++ b/test/sql/transition.test.lua
@@ -3,7 +3,7 @@ engine = test_run:get_cfg('engine')
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
 -- create space
-box.sql.execute("CREATE TABLE foobar (foo PRIMARY KEY, bar)")
+box.sql.execute("CREATE TABLE foobar (foo INT PRIMARY KEY, bar TEXT)")
 
 -- prepare data
 box.sql.execute("INSERT INTO foobar VALUES (1, 'foo')")
@@ -40,7 +40,7 @@ box.sql.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 -- multi-index
 
 -- create space
-box.sql.execute("CREATE TABLE barfoo (bar, foo NUM PRIMARY KEY)")
+box.sql.execute("CREATE TABLE barfoo (bar TEXT, foo NUM PRIMARY KEY)")
 box.sql.execute("CREATE UNIQUE INDEX barfoo2 ON barfoo(bar)")
 
 -- prepare data
@@ -63,11 +63,8 @@ box.sql.execute("DROP TABLE foobar")
 box.sql.execute("DROP TABLE barfoo")
 
 -- attempt to create a table lacking PRIMARY KEY
-box.sql.execute("CREATE TABLE without_rowid_lacking_primary_key(x)")
-
--- attempt to create a table lacking WITHOUT ROWID clause
-box.sql.execute("CREATE TABLE rowid(x)")
+box.sql.execute("CREATE TABLE without_rowid_lacking_primary_key(x BLOB)")
 
 -- create a table with implicit indices (used to SEGFAULT)
-box.sql.execute("CREATE TABLE implicit_indices(a PRIMARY KEY,b,c,d UNIQUE)")
+box.sql.execute("CREATE TABLE implicit_indices(a INT PRIMARY KEY,b INT,c INT,d TEXT UNIQUE)")
 box.sql.execute("DROP TABLE implicit_indices")
diff --git a/test/sql/triggers.result b/test/sql/triggers.result
index f108a12f5..60e9a0ca8 100644
--- a/test/sql/triggers.result
+++ b/test/sql/triggers.result
@@ -197,7 +197,7 @@ immutable_part(box.space._trigger:select())
 - []
 ...
 -- Test target tables restricts.
-box.sql.execute("CREATE TABLE t1(a INT PRIMARY KEY,b);")
+box.sql.execute("CREATE TABLE t1(a INT PRIMARY KEY,b INT);")
 ---
 ...
 space_id = box.space.T1.id
@@ -253,7 +253,7 @@ box.sql.execute("DROP TABLE T1;")
 box.sql.execute("PRAGMA sql_default_engine ('vinyl');")
 ---
 ...
-box.sql.execute("CREATE TABLE m (s1 SCALAR PRIMARY KEY);")
+box.sql.execute("CREATE TABLE m (s1 NUMERIC PRIMARY KEY);")
 ---
 ...
 box.sql.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = DATETIME('now'); END;")
@@ -262,10 +262,10 @@ box.sql.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE
 box.sql.execute("PRAGMA sql_default_engine('memtx');")
 ---
 ...
-box.sql.execute("CREATE TABLE n (s1 CHAR PRIMARY KEY, s2 char);")
+box.sql.execute("CREATE TABLE n (s1 TEXT PRIMARY KEY, s2 TEXT);")
 ---
 ...
-box.sql.execute("INSERT INTO m VALUES ('');")
+box.sql.execute("INSERT INTO m VALUES (0);")
 ---
 ...
 box.sql.execute("INSERT INTO n VALUES ('',null);")
@@ -289,7 +289,7 @@ box.sql.execute("DROP TABLE n;")
 box.sql.execute("PRAGMA sql_default_engine ('memtx');")
 ---
 ...
-box.sql.execute("CREATE TABLE m (s1 SCALAR PRIMARY KEY);")
+box.sql.execute("CREATE TABLE m (s1 NUMERIC PRIMARY KEY);")
 ---
 ...
 box.sql.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = DATETIME('now'); END;")
@@ -298,10 +298,10 @@ box.sql.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE
 box.sql.execute("PRAGMA sql_default_engine('vinyl');")
 ---
 ...
-box.sql.execute("CREATE TABLE n (s1 CHAR PRIMARY KEY, s2 char);")
+box.sql.execute("CREATE TABLE n (s1 TEXT PRIMARY KEY, s2 TEXT);")
 ---
 ...
-box.sql.execute("INSERT INTO m VALUES ('');")
+box.sql.execute("INSERT INTO m VALUES (0);")
 ---
 ...
 box.sql.execute("INSERT INTO n VALUES ('',null);")
diff --git a/test/sql/triggers.test.lua b/test/sql/triggers.test.lua
index 88243f9b7..243e9fc0b 100644
--- a/test/sql/triggers.test.lua
+++ b/test/sql/triggers.test.lua
@@ -74,7 +74,7 @@ box.sql.execute("DROP TABLE t2;")
 immutable_part(box.space._trigger:select())
 
 -- Test target tables restricts.
-box.sql.execute("CREATE TABLE t1(a INT PRIMARY KEY,b);")
+box.sql.execute("CREATE TABLE t1(a INT PRIMARY KEY,b INT);")
 space_id = box.space.T1.id
 
 tuple = {"T1T", space_id, {sql = [[create trigger t1t instead of update on t1 for each row begin delete from t1 WHERE a=old.a+2; end;]]}}
@@ -101,11 +101,11 @@ box.sql.execute("DROP TABLE T1;")
 --
 -- Case 1: Src 'vinyl' table; Dst 'memtx' table
 box.sql.execute("PRAGMA sql_default_engine ('vinyl');")
-box.sql.execute("CREATE TABLE m (s1 SCALAR PRIMARY KEY);")
+box.sql.execute("CREATE TABLE m (s1 NUMERIC PRIMARY KEY);")
 box.sql.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = DATETIME('now'); END;")
 box.sql.execute("PRAGMA sql_default_engine('memtx');")
-box.sql.execute("CREATE TABLE n (s1 CHAR PRIMARY KEY, s2 char);")
-box.sql.execute("INSERT INTO m VALUES ('');")
+box.sql.execute("CREATE TABLE n (s1 TEXT PRIMARY KEY, s2 TEXT);")
+box.sql.execute("INSERT INTO m VALUES (0);")
 box.sql.execute("INSERT INTO n VALUES ('',null);")
 box.sql.execute("UPDATE m SET s1 = 'The Rain In Spain';")
 
@@ -117,11 +117,11 @@ box.sql.execute("DROP TABLE n;")
 
 -- Case 2: Src 'memtx' table; Dst 'vinyl' table
 box.sql.execute("PRAGMA sql_default_engine ('memtx');")
-box.sql.execute("CREATE TABLE m (s1 SCALAR PRIMARY KEY);")
+box.sql.execute("CREATE TABLE m (s1 NUMERIC PRIMARY KEY);")
 box.sql.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = DATETIME('now'); END;")
 box.sql.execute("PRAGMA sql_default_engine('vinyl');")
-box.sql.execute("CREATE TABLE n (s1 CHAR PRIMARY KEY, s2 char);")
-box.sql.execute("INSERT INTO m VALUES ('');")
+box.sql.execute("CREATE TABLE n (s1 TEXT PRIMARY KEY, s2 TEXT);")
+box.sql.execute("INSERT INTO m VALUES (0);")
 box.sql.execute("INSERT INTO n VALUES ('',null);")
 box.sql.execute("UPDATE m SET s1 = 'The Rain In Spain';")
 
diff --git a/test/sql/update-with-nested-select.result b/test/sql/update-with-nested-select.result
index 51825a21d..e75fe5dbb 100644
--- a/test/sql/update-with-nested-select.result
+++ b/test/sql/update-with-nested-select.result
@@ -9,7 +9,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 ...
 -- box.cfg()
 -- create space
-box.sql.execute("CREATE TABLE t1(a integer primary key, b UNIQUE, e);");
+box.sql.execute("CREATE TABLE t1(a integer primary key, b INT UNIQUE, e INT);");
 ---
 ...
 -- Debug
diff --git a/test/sql/update-with-nested-select.test.lua b/test/sql/update-with-nested-select.test.lua
index f9f9b7aad..8e508b164 100644
--- a/test/sql/update-with-nested-select.test.lua
+++ b/test/sql/update-with-nested-select.test.lua
@@ -5,7 +5,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- create space
-box.sql.execute("CREATE TABLE t1(a integer primary key, b UNIQUE, e);");
+box.sql.execute("CREATE TABLE t1(a integer primary key, b INT UNIQUE, e INT);");
 
 -- Debug
 -- box.sql.execute("PRAGMA vdbe_debug=ON ; INSERT INTO zoobar VALUES (111, 222, 'c3', 444)")
diff --git a/test/sql/view.result b/test/sql/view.result
index 2e4230429..b211bcb2e 100644
--- a/test/sql/view.result
+++ b/test/sql/view.result
@@ -10,7 +10,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- Verify that constraints on 'view' option are working.
 -- box.cfg()
 -- Create space and view.
-box.sql.execute("CREATE TABLE t1(a, b, PRIMARY KEY(a, b));");
+box.sql.execute("CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a, b));");
 ---
 ...
 box.sql.execute("CREATE VIEW v1 AS SELECT a+b FROM t1;");
diff --git a/test/sql/view.test.lua b/test/sql/view.test.lua
index 1d73133a2..a6269a1bf 100644
--- a/test/sql/view.test.lua
+++ b/test/sql/view.test.lua
@@ -7,7 +7,7 @@ box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 -- box.cfg()
 
 -- Create space and view.
-box.sql.execute("CREATE TABLE t1(a, b, PRIMARY KEY(a, b));");
+box.sql.execute("CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a, b));");
 box.sql.execute("CREATE VIEW v1 AS SELECT a+b FROM t1;");
 
 -- View can't have any indexes.







More information about the Tarantool-patches mailing list