golang doris 3.0+ Prepare 预编译语句语法错误

Viewed 21
package main

import (
	"database/sql"
	"log"
	"testing"

	_ "github.com/go-sql-driver/mysql"
)

func TestQuery(t *testing.T) {
	// 1.创建连接
	db, err := sql.Open("mysql", "root:123456@tcp(127.0.0.1:9031)/game?charset=utf8mb4&parseTime=True&interpolateParams=true")
	defer db.Close()

	if err != nil {
		log.Fatal(err)
	}
	_, err = db.Prepare("SELECT * FROM log_logon limit ?")
	if err != nil {
		log.Fatal(err)
	}

}

报错:Error 1295 (HY000): Not supported such prepared statement

1 Answers

img_v3_02gh_e3fa6357-64f7-4b90-ac14-b56e777636bg.jpg

测试3.0存算一体没有问题,建议升级一下go的版本。