Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] sql: fix type in meta for unsigned binding
@ 2019-07-24 16:55 Nikita Pettik
  2019-07-24 17:10 ` [tarantool-patches] " Konstantin Osipov
  0 siblings, 1 reply; 4+ messages in thread
From: Nikita Pettik @ 2019-07-24 16:55 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja, Nikita Pettik

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-24 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 16:55 [tarantool-patches] [PATCH] sql: fix type in meta for unsigned binding Nikita Pettik
2019-07-24 17:10 ` [tarantool-patches] " Konstantin Osipov
2019-07-24 17:44   ` n.pettik
2019-07-24 18:23     ` Konstantin Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox