Skip to content

Commit 0ef55ba

Browse files
committed
fixed bug in read-only determination
1 parent 8ac932a commit 0ef55ba

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

integration-tests/go-sql-server-driver/tests/sql-server-orig.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
parallel: true
22
tests:
33
- name: read-only flag prevents modification
4-
skip: "Doltgres read-only mode rejects the connection's session-setup query, so connections cannot be established against a read-only server (behavioral difference from Dolt)"
54
repos:
65
- name: repo1
76
server:
@@ -27,7 +26,6 @@ tests:
2726
columns: ["count"]
2827
rows: [["0"]]
2928
- name: read-only flag still allows select
30-
skip: "Doltgres read-only mode rejects the connection's session-setup query, so even SELECT connections cannot be established against a read-only server (behavioral difference from Dolt)"
3129
repos:
3230
- name: repo1
3331
server:
@@ -52,7 +50,7 @@ tests:
5250
columns: ["c0"]
5351
rows: [["1"]]
5452
- name: read-only flag prevents dolt_commit
55-
skip: "read-only flag does not prevent dolt_commit"
53+
skip: "Doltgres read-only mode does not block the dolt_commit() procedure; it is not classified as a write by the engine read-only guard"
5654
repos:
5755
- name: repo1
5856
server:
@@ -70,7 +68,7 @@ tests:
7068
- query: "select dolt_commit('--allow-empty', '-m', 'msg')"
7169
error_match: "read only"
7270
- name: read-only flag prevents dolt_reset
73-
skip: "read-only flag does not prevent dolt_reset"
71+
skip: "Doltgres read-only mode does not block the dolt_reset() procedure; it is not classified as a write by the engine read-only guard"
7472
repos:
7573
- name: repo1
7674
server:

server/node/call.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func (c *Call) Expressions() []sql.Expression {
6767

6868
// IsReadOnly implements the interface sql.ExecSourceRel.
6969
func (c *Call) IsReadOnly() bool {
70+
// TODO: some procedures are read-only, some are not
7071
return false
7172
}
7273

server/node/context_root_finalizer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (rf *ContextRootFinalizer) DebugString(ctx *sql.Context) string {
5252

5353
// IsReadOnly implements the interface sql.ExecBuilderNode.
5454
func (rf *ContextRootFinalizer) IsReadOnly() bool {
55-
return false
55+
return rf.child.IsReadOnly()
5656
}
5757

5858
// Resolved implements the interface sql.ExecBuilderNode.

0 commit comments

Comments
 (0)