[Tarantool-patches] [PATCH v3 2/2] sql: print span more properly

roman roman.habibov at tarantool.org
Tue Jun 23 00:14:18 MSK 2020


Hi. Thanks for the review.

On 16.06.2020 01:18, Vladislav Shpilevoy wrote:
> Thanks for the patch!
>
> On 11/06/2020 17:18, Roman Khabibov wrote:
>> There were several cases where instead of the correct column
>> span, the column name was printed. Fix this bug.
>>
>> Follow up #3962
> This is rather a follow up for 4407. Because the
> bug was introduced here:
> https://github.com/tarantool/tarantool/commit/f89d65652c3003dd62c18a88b73a8ebbae50aab0#diff-6b3f29fe63589aaefab6b4beb6cb572e
>
> It is not related to auto columns.

commit 623e0ebb8ac53dd1a0c17f45315b15b720cf71ba
Author: Roman Khabibov <roman.habibov at tarantool.org>
Date:   Wed Jun 10 15:03:45 2020 +0300

     sql: print span more properly

     There were several cases where instead of the correct column
     span, the column name was printed. Fix this bug.

     Follow up #4407

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 7a56136..2955753 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1849,7 +1849,7 @@ generate_column_metadata(struct Parse *pParse, 
struct SrcList *pTabList,
                  if (space->sequence != NULL &&
                      space->sequence_fieldno == (uint32_t) iCol)
                      vdbe_metadata_set_col_autoincrement(v, i);
-                if (colname != NULL)
+                if (span != NULL)
                      vdbe_metadata_set_col_span(v, i, span);
              }
          } else {
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 25bac6d..dc1e911 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -65,7 +65,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
  execute("SELECT c FROM t;")
   | ---
   | - metadata:
- |   - span: C
+ |   - span: c
   |     type: string
   |     is_nullable: true
   |     name: C
@@ -89,16 +89,16 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
  execute("SELECT id, a, c FROM t;")
   | ---
   | - metadata:
- |   - span: ID
+ |   - span: id
   |     type: integer
   |     is_autoincrement: true
   |     name: ID
   |     is_nullable: false
   |   - type: integer
- |     span: A
+ |     span: a
   |     name: A
   |     is_nullable: false
- |   - span: C
+ |   - span: c
   |     type: string
   |     is_nullable: true
   |     name: C




More information about the Tarantool-patches mailing list