[tarantool-patches] Re: [PATCH v4 8/8] sql: remove sqlErrorMsg()

n.pettik korablev at tarantool.org
Tue Mar 26 21:28:21 MSK 2019


> diff --git a/src/box/sql/select.c b/src/box/sql/select.c
> index e217c19..778de2c 100644
> --- a/src/box/sql/select.c
> +++ b/src/box/sql/select.c
> @@ -1466,25 +1466,25 @@ sql_expr_list_to_key_info(struct Parse *parse, struct ExprList *list, int start)
> /*
>  * Name of the connection operator, used for error messages.
>  */
> -static const char *
> -selectOpName(int id)
> +const char *
> +select_op_name(int op_id)

Add sql_ prefix.

> {
> -	char *z;
> -	switch (id) {
> +	const char *op_name;

IMHO don’t see much sense in this renaming: function is small and straight
enough to use old brief names.

> +	switch (op_id) {
> 	case TK_ALL:
> -		z = "UNION ALL";
> +		op_name = "UNION ALL";
> 		break;
> 	case TK_INTERSECT:
> -		z = "INTERSECT";
> +		op_name = "INTERSECT";
> 		break;
> 	case TK_EXCEPT:
> -		z = "EXCEPT";
> +		op_name = "EXCEPT";
> 		break;
> 	default:
> -		z = "UNION";
> +		op_name = "UNION";
> 		break;
> 	}
> -	return z;
> +	return op_name;
> }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20190326/eef61d23/attachment.html>


More information about the Tarantool-patches mailing list