[
https://issues.apache.org/jira/browse/IGNITE-24146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maksim Zhuravkov updated IGNITE-24146:
--------------------------------------
Description:
Because system views do not support transaction at the moment (they basically
run at dirty reads isolation level), all queries and scripts in the example
below work.
Let's update statement validation logic to reject transactions that refer
system views and run within explicit transactions.
{code:java}
@Test
public void test() {
{
Transaction tx = igniteTx().begin(new
TransactionOptions().readOnly(true));
sql(tx, "SELECT * FROM system.system_views");
tx.commit();
}
{
Transaction tx = igniteTx().begin(new
TransactionOptions().readOnly(false));
sql(tx, "SELECT * FROM system.system_views");
tx.commit();
}
{
igniteSql().executeScript("START TRANSACTION; SELECT * FROM
system.system_views; COMMIT");
igniteSql().executeScript("START TRANSACTION READ ONLY; SELECT *
FROM system.system_views; COMMIT");
igniteSql().executeScript("START TRANSACTION READ WRITE; SELECT *
FROM system.system_views; COMMIT");
}
}
{code}
was:
Because system views do not support transaction at the moment (they basically
run at dirty reads isolation level), all queries and scripts in the example
below work.
Let's update statement validation logic to reject transactions that refer
system views and run within explicit transactions.
{code:java}
@Test
public void test() {
{
Transaction tx = igniteTx().begin(new
TransactionOptions().readOnly(true));
sql(tx, "SELECT * FROM system.system_views");
tx.commit();
}
{
Transaction tx = igniteTx().begin(new
TransactionOptions().readOnly(false));
sql(tx, "SELECT * FROM system.system_views");
tx.commit();
}
{
igniteSql().executeScript("START TRANSACTION; SELECT * FROM
system.system_views; COMMIT");
igniteSql().executeScript("START TRANSACTION READ ONLY; SELECT *
FROM system.system_views; COMMIT");
igniteSql().executeScript("START TRANSACTION READ WRITE; SELECT *
FROM system.system_views; COMMIT");
}
}
{code}
> Sql. Querying system views with explicit transactions should not be possible
> ----------------------------------------------------------------------------
>
> Key: IGNITE-24146
> URL: https://issues.apache.org/jira/browse/IGNITE-24146
> Project: Ignite
> Issue Type: Improvement
> Components: sql
> Reporter: Maksim Zhuravkov
> Priority: Major
> Labels: ignite-3
>
> Because system views do not support transaction at the moment (they basically
> run at dirty reads isolation level), all queries and scripts in the example
> below work.
> Let's update statement validation logic to reject transactions that refer
> system views and run within explicit transactions.
> {code:java}
> @Test
> public void test() {
> {
> Transaction tx = igniteTx().begin(new
> TransactionOptions().readOnly(true));
> sql(tx, "SELECT * FROM system.system_views");
> tx.commit();
> }
> {
> Transaction tx = igniteTx().begin(new
> TransactionOptions().readOnly(false));
> sql(tx, "SELECT * FROM system.system_views");
> tx.commit();
> }
> {
> igniteSql().executeScript("START TRANSACTION; SELECT * FROM
> system.system_views; COMMIT");
> igniteSql().executeScript("START TRANSACTION READ ONLY; SELECT *
> FROM system.system_views; COMMIT");
> igniteSql().executeScript("START TRANSACTION READ WRITE; SELECT *
> FROM system.system_views; COMMIT");
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)