Go 1.12.9
The following code should work successfully.
In fact SELECT 0XBEAF is valid spanner query.
package main
import (
"log"
"cloud.google.com/go/spanner/spansql"
)
func main() {
log.Println(spansql.ParseQuery("SELECT 0XBEAF"))
}
The below error is shown.
2019/08/22 14:23:22 {{[] [] <nil>} [] <nil>} unexpected trailing query contents "XBEAF"
CL for this is here.
In fact
SELECT 0XBEAFis valid spanner query.
Actually spanner accepts this:

However, the document says:
Integer literals are either a sequence of decimal digits (0–9) or a hexadecimal value that is prefixed with "0x". Integers can be prefixed by "+" or "-" to represent positive and negative values, respectively.
Maybe it is documentation bug, or spanner internal bug.
Thanks for the report. However, the entire spansql/spannertest library has a big TODO to support case insensitivity properly, and we should address that, rather than making individual fixes. For now, just use 0x-prefixed literals.
IMHO this issue isn't be fixed with case insensitivity supports because it is really individual from other case insensitivity problems.
At least, to me, there is only way to solve this issue and other TODOs at once, that the tokenizer unifies character case on reading character. But I don't think it is good solution. What do you think?
Okay, you make a fair case. Let's proceed with your change.
Most helpful comment
Okay, you make a fair case. Let's proceed with your change.