[Tarantool-patches] [PATCH v2 2/9] sql: remove PRAGMA "short_column_names"

Nikita Pettik korablev at tarantool.org
Tue Dec 31 02:12:18 MSK 2019


On 30 Dec 19:43, imeevma at tarantool.org wrote:
> @@ -1828,11 +1825,12 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
>  			struct space_def *space_def = space->def;
>  			assert(iCol >= 0 && iCol < (int)space_def->field_count);
>  			zCol = space_def->fields[iCol].name;
> -			const char *name = colname;
> -			if (name == NULL) {
> -				if (!shortNames && !fullNames) {
> -					name = span;
> -				} else if (fullNames) {
> +			const char *name = NULL;
> +			if (pEList->a[i].zName != NULL) {
> +				name = pEList->a[i].zName;
> +			} else {
> +				int flags = pParse->sql_flags;
> +				if ((flags & SQL_FullColNames) != 0) {
>  					name = tt_sprintf("%s.%s",
>  							  space_def->name,

Please, apply this refactoring:

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 0fc86e550..65e41f219 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1825,10 +1825,8 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
                        struct space_def *space_def = space->def;
                        assert(iCol >= 0 && iCol < (int)space_def->field_count);
                        zCol = space_def->fields[iCol].name;
-                       const char *name = NULL;
-                       if (pEList->a[i].zName != NULL) {
-                               name = pEList->a[i].zName;
-                       } else {
+                       const char *name = colname;
+                       if (name == NULL) {



More information about the Tarantool-patches mailing list