add online deferred invalidation keyword for oracle (#3409)

* add online deferred invalidation keyword for oracle

* test

* remove online option from sql server drop index - it can only apply to clustered indices

Co-authored-by: Michael Buckley <michael.buckley@smilecdr.com>
This commit is contained in:
Tadgh 2022-02-22 13:44:28 -08:00 committed by GitHub
parent cc44deee1a
commit fcada39044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 7 deletions

View File

@ -137,7 +137,7 @@ public class AddIndexTask extends BaseTableTask {
postgresOnline = "CONCURRENTLY ";
break;
case ORACLE_12C:
oracleOnlineDeferred = " ONLINE DEFERRED";
oracleOnlineDeferred = " ONLINE DEFERRED INVALIDATION";
break;
case MSSQL_2012:
oracleOnlineDeferred = " WITH (ONLINE = ON)";

View File

@ -112,7 +112,7 @@ public class DropIndexTask extends BaseTableTask {
sql.add("drop index " + myIndexName + (myOnline?" ONLINE":""));
break;
case MSSQL_2012:
sql.add("drop index " + getTableName() + "." + myIndexName + (myOnline?" WITH (ONLINE = ON)":""));
sql.add("drop index " + getTableName() + "." + myIndexName );
break;
}
}

View File

@ -177,7 +177,7 @@ public class AddIndexTest extends BaseTest {
assertEquals("create index CONCURRENTLY IDX_ANINDEX on SOMETABLE(PID, TEXTCOL)", mySql);
break;
case ORACLE_12C:
assertEquals("create index IDX_ANINDEX on SOMETABLE(PID, TEXTCOL) ONLINE DEFERRED", mySql);
assertEquals("create index IDX_ANINDEX on SOMETABLE(PID, TEXTCOL) ONLINE DEFERRED INVALIDATION", mySql);
break;
case MSSQL_2012:
assertEquals("create index IDX_ANINDEX on SOMETABLE(PID, TEXTCOL) WITH (ONLINE = ON)", mySql);

View File

@ -9,7 +9,6 @@ import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.MethodSource;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;
@ -18,9 +17,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.not;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class DropIndexTest extends BaseTest {
@ -245,7 +242,7 @@ public class DropIndexTest extends BaseTest {
assertThat(mySql, equalTo(asList("drop index IDX_ANINDEX ONLINE")));
break;
case MSSQL_2012:
assertThat(mySql, equalTo(asList("drop index SOMETABLE.IDX_ANINDEX WITH (ONLINE = ON)")));
assertThat(mySql, equalTo(asList("drop index SOMETABLE.IDX_ANINDEX")));
break;
case POSTGRES_9_4:
assertThat(mySql, equalTo(asList("drop index CONCURRENTLY IDX_ANINDEX")));