Skip to content

Commit 79a09a2

Browse files
craig[bot]rafisskoorosh
committed
108203: sql: use PG error code for txn errors r=rafiss a=rafiss Epic: None Release note: None 108280: sql: skip TestSQLStatsRegions test r=koorosh a=koorosh Skip test due to increased failures after recent fixes. Release note: None Epic: None Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Andrii Vorobiov <[email protected]>
3 parents d6f6de2 + 13848cf + de8b869 commit 79a09a2

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

pkg/ccl/testccl/sqlstatsccl/sql_stats_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func TestSQLStatsRegions(t *testing.T) {
3939
defer leaktest.AfterTest(t)()
4040
defer log.Scope(t).Close(t)
4141

42+
skip.WithIssue(t, 107582, "flaky test")
4243
skip.UnderRace(t, "test is to slow for race")
4344
skip.UnderStress(t, "test is too heavy to run under stress")
4445

pkg/sql/exec_util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,8 @@ var overrideAlterPrimaryRegionInSuperRegion = settings.RegisterBoolSetting(
739739
false,
740740
).WithPublic()
741741

742-
var errNoTransactionInProgress = errors.New("there is no transaction in progress")
743-
var errTransactionInProgress = errors.New("there is already a transaction in progress")
742+
var errNoTransactionInProgress = pgerror.New(pgcode.NoActiveSQLTransaction, "there is no transaction in progress")
743+
var errTransactionInProgress = pgerror.New(pgcode.ActiveSQLTransaction, "there is already a transaction in progress")
744744

745745
const sqlTxnName string = "sql txn"
746746
const metricsSampleInterval = 10 * time.Second

pkg/sql/logictest/testdata/logic_test/txn

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ x y
142142
statement ok
143143
BEGIN TRANSACTION
144144

145-
statement error there is already a transaction in progress
145+
statement error pgcode 25001 there is already a transaction in progress
146146
BEGIN TRANSACTION
147147

148148
statement ok
@@ -156,10 +156,10 @@ BEGIN TRANSACTION
156156
statement ok
157157
UPDATE kv SET v = 'b' WHERE k in ('a')
158158

159-
statement error there is already a transaction in progress
159+
statement error pgcode 25001 there is already a transaction in progress
160160
BEGIN TRANSACTION
161161

162-
statement error current transaction is aborted, commands ignored until end of transaction block
162+
statement error pgcode 25P02 current transaction is aborted, commands ignored until end of transaction block
163163
SELECT * FROM kv
164164

165165
statement ok
@@ -176,15 +176,15 @@ BEGIN; END
176176

177177
# COMMIT/ROLLBACK without a transaction are errors.
178178

179-
statement error there is no transaction in progress
179+
statement error pgcode 25P01 there is no transaction in progress
180180
COMMIT TRANSACTION
181181

182-
statement error there is no transaction in progress
182+
statement error pgcode 25P01 there is no transaction in progress
183183
ROLLBACK TRANSACTION
184184

185185
# Set isolation level without a transaction is an error.
186186

187-
statement error there is no transaction in progress
187+
statement error pgcode 25P01 there is no transaction in progress
188188
SET TRANSACTION ISOLATION LEVEL SNAPSHOT
189189

190190
statement ok
@@ -393,7 +393,7 @@ COMMIT
393393

394394
# User priority.
395395

396-
statement error there is no transaction in progress
396+
statement error pgcode 25P01 there is no transaction in progress
397397
SET TRANSACTION PRIORITY LOW
398398

399399
statement ok

pkg/sql/pgwire/testdata/pgtest/implicit_txn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ErrorResponse
5959
ReadyForQuery
6060
----
6161
{"Type":"BindComplete"}
62-
{"Type":"ErrorResponse","Code":"XXUUU"}
62+
{"Type":"ErrorResponse","Code":"25001"}
6363
{"Type":"ReadyForQuery","TxStatus":"E"}
6464

6565
send

0 commit comments

Comments
 (0)