-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
spansql error (want scalar type) #426
Comments
I tried verifying with an actual spanner instance, just to make sure it's not something wonky with the emulator, and got the same error. Then downgraded to 4.10.0, and it seems to work there (all the migrations run without the Interestingly, the following code seems to work Ok (and error if I put invalid DDL in the same block): package main
import "cloud.google.com/go/spanner/spansql"
import "fmt"
func main() {
textString := `ALTER TABLE foo ALTER COLUMN createdAt SET OPTIONS (allow_commit_timestamp=true);`
_, err := spansql.ParseDDL("", textString)
if err != nil {
fmt.Println(err)
}
} |
Fairly simple / self-contained repo case (again, against real db)
And, of course, without the x-clean-statements, it barfs completely (odd, though, because Spanner DDL parser does seem to accept semi-colons etc.)
I am able to run those DDL statements directly using the CLI
|
Tried adding a
which seems to parse fine if I pass it into the program above.
|
Maybe related? googleapis/google-cloud-go#2621 |
so, updating to v1.8.1-0.20200815011802-3e0a3eecc468 does fix it. Will work on trying to get them to cut a release. |
Describe the Bug
I'm getting an error running the below command with the latest version of migrate
Steps to Reproduce
Steps to reproduce the behavior:
ALTER TABLE foo ALTER COLUMN createdAt SET OPTIONS (allow_commit_timestamp=true);
This looks pretty much exactly like the example in https://cloud.google.com/spanner/docs/schema-updates (adding the spaces doesn't make a difference)
migrate -verbose -path ./spanner/users -database "spanner://projects/fakeproject/instances/test/databases/users?x-clean-statements=True
(which appears to be a spansql error, so I assume this is coming from migrate vs. the emulator it's talking to)
Expected Behavior
The migration would apply.
Migrate Version
v4.12.2
Loaded Source Drivers
godoc-vfs, gcs, file, s3, github, github-ee, gitlab, go-bindata
Loaded Database Drivers
cassandra, crdb-postgres, firebird, mongodb, mysql, sqlserver, stub, cockroach, neo4j, clickhouse, cockroachdb, firebirdsql, mongodb+srv, postgres, postgresql, redshift, spanner
Go Version
[running linux binary]
Stacktrace
Please provide if available
Additional context
Using emulator to run this in CI
The text was updated successfully, but these errors were encountered: