Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c37ebb5

Browse files
Tweak naming: connection_txn_stmt => connection_exec_stmt
1 parent 6902738 commit c37ebb5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Modules/_sqlite/connection.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ new_statement_cache(pysqlite_Connection *self, pysqlite_state *state,
157157
}
158158

159159
static inline int
160-
connection_txn_stmt(pysqlite_Connection *self, const char *sql)
160+
connection_exec_stmt(pysqlite_Connection *self, const char *sql)
161161
{
162162
int rc;
163163
Py_BEGIN_ALLOW_THREADS
@@ -311,7 +311,7 @@ pysqlite_connection_init_impl(pysqlite_Connection *self, PyObject *database,
311311
self->initialized = 1;
312312

313313
if (autocommit == AUTOCOMMIT_DISABLED) {
314-
(void)connection_txn_stmt(self, "BEGIN");
314+
(void)connection_exec_stmt(self, "BEGIN");
315315
}
316316
return 0;
317317

@@ -385,7 +385,7 @@ connection_close(pysqlite_Connection *self)
385385
if (self->autocommit == AUTOCOMMIT_DISABLED &&
386386
!sqlite3_get_autocommit(self->db))
387387
{
388-
(void)connection_txn_stmt(self, "ROLLBACK");
388+
(void)connection_exec_stmt(self, "ROLLBACK");
389389
}
390390

391391
free_callback_contexts(self);
@@ -603,16 +603,16 @@ pysqlite_connection_commit_impl(pysqlite_Connection *self)
603603

604604
if (self->autocommit == AUTOCOMMIT_COMPAT) {
605605
if (!sqlite3_get_autocommit(self->db)) {
606-
if (connection_txn_stmt(self, "COMMIT") < 0) {
606+
if (connection_exec_stmt(self, "COMMIT") < 0) {
607607
return NULL;
608608
}
609609
}
610610
}
611611
else if (self->autocommit == AUTOCOMMIT_DISABLED) {
612-
if (connection_txn_stmt(self, "COMMIT") < 0) {
612+
if (connection_exec_stmt(self, "COMMIT") < 0) {
613613
return NULL;
614614
}
615-
if (connection_txn_stmt(self, "BEGIN") < 0) {
615+
if (connection_exec_stmt(self, "BEGIN") < 0) {
616616
return NULL;
617617
}
618618
}
@@ -637,16 +637,16 @@ pysqlite_connection_rollback_impl(pysqlite_Connection *self)
637637

638638
if (self->autocommit == AUTOCOMMIT_COMPAT) {
639639
if (!sqlite3_get_autocommit(self->db)) {
640-
if (connection_txn_stmt(self, "ROLLBACK") < 0) {
640+
if (connection_exec_stmt(self, "ROLLBACK") < 0) {
641641
return NULL;
642642
}
643643
}
644644
}
645645
else if (self->autocommit == AUTOCOMMIT_DISABLED) {
646-
if (connection_txn_stmt(self, "ROLLBACK") < 0) {
646+
if (connection_exec_stmt(self, "ROLLBACK") < 0) {
647647
return NULL;
648648
}
649-
if (connection_txn_stmt(self, "BEGIN") < 0) {
649+
if (connection_exec_stmt(self, "BEGIN") < 0) {
650650
return NULL;
651651
}
652652
}
@@ -2352,18 +2352,18 @@ set_autocommit(pysqlite_Connection *self, PyObject *val, void *Py_UNUSED(ctx))
23522352
}
23532353
if (self->autocommit == AUTOCOMMIT_ENABLED) {
23542354
if (!sqlite3_get_autocommit(self->db)) {
2355-
if (connection_txn_stmt(self, "COMMIT") < 0) {
2355+
if (connection_exec_stmt(self, "COMMIT") < 0) {
23562356
return -1;
23572357
}
23582358
}
23592359
}
23602360
else if (self->autocommit == AUTOCOMMIT_DISABLED) {
23612361
if (!sqlite3_get_autocommit(self->db)) {
2362-
if (connection_txn_stmt(self, "COMMIT") < 0) {
2362+
if (connection_exec_stmt(self, "COMMIT") < 0) {
23632363
return -1;
23642364
}
23652365
}
2366-
if (connection_txn_stmt(self, "BEGIN") < 0) {
2366+
if (connection_exec_stmt(self, "BEGIN") < 0) {
23672367
return -1;
23682368
}
23692369
}

0 commit comments

Comments
 (0)