[Tarantool-patches] [PATCH] sql: forbid data changes in read-only mode

Nikita Pettik korablev at tarantool.org
Fri Nov 13 17:01:05 MSK 2020


On 10 Nov 14:29, sergos at tarantool.org wrote:
> From: Sergey Ostanevich <sergos at tarantool.org>
> 
> +box.execute("ALTER TABLE TEST ADD CONSTRAINT 'uk' UNIQUE (B)")
> +test:is(
> +    tostring(err),
> +    expected_err,
> +    "add constraint should fail in read-only mode"
> +)
> +box.execute("ALTER TABLE TEST RENAME TO TEST2")
> +test:is(
> +    tostring(err),
> +    expected_err,
> +    "rename should fail in read-only mode"
> +)
> +res, err = box.execute("DROP TABLE TEST")
> +test:is(
> +    tostring(err),
> +    expected_err,
> +    "drop table should fail in read-only mode"
> +)
> +
> +-- cleanup
> +box.cfg{read_only=false}
> +res, err = box.execute("DROP TABLE TEST")
> +
> +os.exit(test:check() and 0 or 1)

Not sure if we have to call os.exit() at the end of tap tests.
Otherwise LGTM



More information about the Tarantool-patches mailing list