[tarantool-patches] Re: [PATCH v2 4/4] sql: remove OP_LoadPtr

n.pettik korablev at tarantool.org
Tue Jul 10 21:34:57 MSK 2018


> @@ -2969,12 +2964,9 @@ sql_create_index(struct Parse *parse, struct Token *token,
> 			goto exit_create_index;
> 
> 		sql_set_multi_write(parse, true);
> -
> -
> -		sqlite3VdbeAddOp2(v, OP_SIDtoPtr, BOX_INDEX_ID,
> -				  index_space_ptr_reg);
> -		sqlite3VdbeAddOp4Int(v, OP_OpenWrite, iCursor, 0,
> -				     index_space_ptr_reg, 6);
> +		sqlite3VdbeAddOp4(v, OP_OpenWrite, iCursor, 0, 0,
> +				  (void *)space_by_id(BOX_INDEX_ID),
> +				  P4_SPACEPTR);
> 		sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ);

Wait, AFAIK SIDtoPtr was used deliberately taking into consideration
the fact that DDL may change ptr to space. So conversion id -> space ptr
is delayed until vdbe execution (right before cursor opening). Am I wrong?



More information about the Tarantool-patches mailing list