Skip to content

Commit c5cf84a

Browse files
authored
fix echo variable (#117)
1 parent 17b728e commit c5cf84a

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

generate_perror/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"log"
2121
"os"
2222
"os/exec"
23+
"path/filepath"
2324
"regexp"
2425
"sort"
2526
"strconv"

r/example.result

+1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ info:
4545
INSERT t1 VALUES (1, 1), (1, 1) ON DUPLICATE KEY UPDATE f1 = 2, f2 = 2;
4646
affected rows: 3
4747
info: Records: 2 Duplicates: 1 Warnings: 0
48+
1
4849
use `test`;;

src/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func (t *tester) Run() error {
390390
case Q_ERROR:
391391
t.expectedErrs = strings.Split(strings.TrimSpace(s), ",")
392392
case Q_ECHO:
393-
varSearch := regexp.MustCompile(`\\$([A-Za-z0-9_]+)( |$)`)
393+
varSearch := regexp.MustCompile(`\$([A-Za-z0-9_]+)( |$)`)
394394
s := varSearch.ReplaceAllStringFunc(s, func(s string) string {
395395
return os.Getenv(varSearch.FindStringSubmatch(s)[1])
396396
})

t/example.test

+3
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,7 @@ INSERT t1 VALUES (1, 1);
4444
INSERT t1 VALUES (1, 1), (1, 1) ON DUPLICATE KEY UPDATE f1 = 2, f2 = 2;
4545
--disable_info
4646

47+
--let $a=`select 1`
48+
--echo $a
49+
4750
use `test`;;

0 commit comments

Comments
 (0)