Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GG-14875 Improve error's logging for DDL statements. #139

Open
wants to merge 1 commit into
base: ignite-2.5-master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteCluster;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.cache.QueryEntity;
import org.apache.ignite.cache.QueryIndex;
Expand Down Expand Up @@ -95,6 +96,9 @@ public class DdlStatementsProcessor {
/** Indexing. */
IgniteH2Indexing idx;

/** Logger. */
private IgniteLogger log;

/** Is backward compatible handling of UUID through DDL enabled. */
private static final boolean handleUuidAsByte =
IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_SQL_UUID_DDL_BYTE_FORMAT, false);
Expand All @@ -108,6 +112,8 @@ public class DdlStatementsProcessor {
public void start(final GridKernalContext ctx, IgniteH2Indexing idx) {
this.ctx = ctx;
this.idx = idx;

log = ctx.log(DdlStatementsProcessor.class);
}

/**
Expand Down Expand Up @@ -237,6 +243,8 @@ else if (cmd instanceof SqlDropUserCommand) {
return H2Utils.zeroCursor();
}
catch (SchemaOperationException e) {
U.error(log, "DDL statement execution failed. sql: " + sql, e);

throw convert(e);
}
catch (IgniteSQLException e) {
Expand Down Expand Up @@ -490,7 +498,8 @@ else if (stmt0 instanceof GridSqlAlterTableDropColumn) {
return resCur;
}
catch (SchemaOperationException e) {
U.error(null, "DDL operation failure", e);
U.error(log, "DDL operation failure. sql: " + sql, e);

throw convert(e);
}
catch (IgniteSQLException e) {
Expand Down