diff --git a/generate_perror/main.go b/generate_perror/main.go index 5773346..6706638 100644 --- a/generate_perror/main.go +++ b/generate_perror/main.go @@ -20,6 +20,7 @@ import ( "log" "os" "os/exec" + "path/filepath" "regexp" "sort" "strconv" diff --git a/r/example.result b/r/example.result index d4be568..6e5cb8d 100644 --- a/r/example.result +++ b/r/example.result @@ -45,4 +45,5 @@ info: INSERT t1 VALUES (1, 1), (1, 1) ON DUPLICATE KEY UPDATE f1 = 2, f2 = 2; affected rows: 3 info: Records: 2 Duplicates: 1 Warnings: 0 +1 use `test`;; diff --git a/src/main.go b/src/main.go index e051fc7..d8d6e6d 100644 --- a/src/main.go +++ b/src/main.go @@ -390,7 +390,7 @@ func (t *tester) Run() error { case Q_ERROR: t.expectedErrs = strings.Split(strings.TrimSpace(s), ",") case Q_ECHO: - varSearch := regexp.MustCompile(`\\$([A-Za-z0-9_]+)( |$)`) + varSearch := regexp.MustCompile(`\$([A-Za-z0-9_]+)( |$)`) s := varSearch.ReplaceAllStringFunc(s, func(s string) string { return os.Getenv(varSearch.FindStringSubmatch(s)[1]) }) diff --git a/t/example.test b/t/example.test index 95d081c..4b6f18d 100644 --- a/t/example.test +++ b/t/example.test @@ -44,4 +44,7 @@ INSERT t1 VALUES (1, 1); INSERT t1 VALUES (1, 1), (1, 1) ON DUPLICATE KEY UPDATE f1 = 2, f2 = 2; --disable_info +--let $a=`select 1` +--echo $a + use `test`;;