[tarantool-patches] [PATCH] sql: fix type in meta for unsigned binding

Nikita Pettik korablev at tarantool.org
Wed Jul 24 19:55:08 MSK 2019


It was decided that for all integer literals we would return "INTEGER"
type, not "UNSIGNED". Accidentally, after substitution of unsigned
binding value type was set to "UNSIGNED". Let's fix that and set
"INTEGER" type.
---
Branch: https://github.com/tarantool/tarantool/tree/np/fix-meta-uint-binding

 src/box/sql/vdbeapi.c  | 2 +-
 test/sql/iproto.result | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index ecf1b3601..f5885230b 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -1005,7 +1005,7 @@ sql_bind_uint64(struct sql_stmt *stmt, int i, uint64_t value)
 	struct Vdbe *p = (struct Vdbe *) stmt;
 	if (vdbeUnbind(p, i) != 0)
 		return -1;
-	int rc = sql_bind_type(p, i, "UNSIGNED");
+	int rc = sql_bind_type(p, i, "INTEGER");
 	mem_set_u64(&p->aVar[i - 1], value);
 	return rc;
 }
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 26d12a51a..9639ba7a6 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -374,11 +374,11 @@ cn:execute('select $2, $1, $3', parameters)
 ---
 - metadata:
   - name: $2
-    type: UNSIGNED
+    type: INTEGER
   - name: $1
-    type: UNSIGNED
+    type: INTEGER
   - name: $3
-    type: UNSIGNED
+    type: INTEGER
   rows:
   - [22, 11, 33]
 ...
-- 
2.15.1





More information about the Tarantool-patches mailing list