Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit73a2b5d

Browse files
committed
Use async commit
1 parent79aafd9 commit73a2b5d

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

‎tests/dtmbench.cpp‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ void exec(transaction_base& txn, char const* sql, ...)
101101
txn.exec(buf);
102102
}
103103

104+
voidinsert(pipeline& pipe,charconst* sql, ...)
105+
{
106+
va_list args;
107+
va_start(args, sql);
108+
char buf[1024];
109+
vsprintf(buf, sql, args);
110+
va_end(args);
111+
pipe.insert(buf);
112+
}
113+
104114
xid_texecQuery( transaction_base& txn,charconst* sql, ...)
105115
{
106116
va_list args;
@@ -194,15 +204,19 @@ void* writer(void* arg)
194204
continue;
195205
}
196206

197-
#if1
198-
exec(srcTx,"prepare transaction '%u'", xid);
199-
exec(dstTx,"prepare transaction '%u'", xid);
200-
exec(srcTx,"commit prepared '%u'", xid);
201-
exec(dstTx,"commit prepared '%u'", xid);
202-
#else
203207
pipelinesrcPipe(srcTx);
204208
pipelinedstPipe(dstTx);
205209

210+
#if1
211+
insert(srcPipe,"prepare transaction '%u'", xid);
212+
insert(dstPipe,"prepare transaction '%u'", xid);
213+
srcPipe.complete();
214+
dstPipe.complete();
215+
insert(srcPipe,"commit prepared '%u'", xid);
216+
insert(dstPipe,"commit prepared '%u'", xid);
217+
srcPipe.complete();
218+
dstPipe.complete();
219+
#else
206220
srcPipe.insert("commit transaction");
207221
dstPipe.insert("commit transaction");
208222

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp