[tarantool-patches] Re: [PATCH v3 10/10] sql: VDBE tests for trigger existence

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Jun 19 18:23:57 MSK 2018


Thanks for the fixes!

> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
> index c1df880..9f7f50d 100644
> --- a/src/box/sql/vdbe.c
> +++ b/src/box/sql/vdbe.c
> @@ -2999,8 +3003,10 @@ case OP_CheckViewReferences: {
>   	struct space *space = space_by_id(space_id);
>   	assert(space != NULL);
>   	if (space->def->view_ref_count > 0) {
> -		sqlite3VdbeError(p,"Can't drop table %s: other views depend "
> -				 "on this space",  space->def->name);
> +		box_error_set(__FILE__, __LINE__, ER_DROP_SPACE,
> +			      tnt_errcode_desc(ER_DROP_SPACE),
> +			      space->def->name,
> +			      "other views depend on this space");

As I told you verbally, here you can use directly diag_set since
you know the concrete error code and parameters.

So please, apply this diff:

@@ -3003,10 +3003,8 @@ case OP_CheckViewReferences: {
  	struct space *space = space_by_id(space_id);
  	assert(space != NULL);
  	if (space->def->view_ref_count > 0) {
-		box_error_set(__FILE__, __LINE__, ER_DROP_SPACE,
-			      tnt_errcode_desc(ER_DROP_SPACE),
-			      space->def->name,
-			      "other views depend on this space");
+		diag_set(ClientError, ER_DROP_SPACE, space->def->name,
+			 "other views depend on this space");
  		rc = SQL_TARANTOOL_ERROR;
  		goto abort_due_to_error;
  	}

>   		rc = SQL_TARANTOOL_ERROR;
>   		goto abort_due_to_error;
>   	}




More information about the Tarantool-patches mailing list