-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
We can't execute update ... where colName ...
when the column is WriteOnly
state
#15567
Comments
update ... where colName ...
when the column is WriteOnly
state
expect execute successful |
@jzdxeb |
thx a lot |
This comment has been minimized.
This comment has been minimized.
in branch release 3.0 mysql> update t set b=5 where a=1;
ERROR 1054 (42S22): Unknown column 'b' in 'field list'
mysql> update t set a=5 where b=1;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0 is expect ? |
Column B in this scene is not public, is it? If column b is not public, it is the problem described by this issue. |
branch master update t set a=5 where b=1 return successfully timeline
diff --git a/Makefile b/Makefile
index 793d44b7c..3af1e8137 100644
--- a/Makefile
+++ b/Makefile
@@ -214,9 +214,9 @@ endif
server:
ifeq ($(TARGET), "")
- CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o bin/tidb-server tidb-server/main.go
+ CGO_ENABLED=0 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o bin/tidb-server tidb-server/main.go
else
- CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)' tidb-server/main.go
+ CGO_ENABLED=0 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)' tidb-server/main.go
endif
server_check:
diff --git a/ddl/column.go b/ddl/column.go
index a38c3afab..5e0cf9214 100644
--- a/ddl/column.go
+++ b/ddl/column.go
@@ -515,6 +515,7 @@ func onDropColumn(t *meta.Meta, job *model.Job) (ver int64, _ error) {
}
ver, err = updateVersionAndTableInfoWithCheck(t, job, tblInfo, originalState != colInfo.State)
case model.StateWriteOnly:
+ time.Sleep(time.Second * 20)
// write only -> delete only
job.SchemaState = model.StateDeleteOnly
colInfo.State = model.StateDeleteOnly |
/assign |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Do the following:
2. What did you expect to see?
Retrun an error like
[planner:1054]Unknown column 'b' in 'field list'
.3. What did you see instead?
Statement executed successfully
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)Release Version: v4.0.0-beta.2-46-gfd0235d03
Git Commit Hash: fd0235d
Git Branch: master
The text was updated successfully, but these errors were encountered: