...
|
...
|
@@ -205,7 +205,6 @@ $dbi->type_rule(
|
205
|
205
|
$date_typename => sub { '2010-' . $_[0] }
|
206
|
206
|
}
|
207
|
207
|
);
|
208
|
|
-$DB::single = 1;
|
209
|
208
|
$dbi->insert({key1 => '01-01'}, table => 'table1');
|
210
|
209
|
$result = $dbi->select(table => 'table1');
|
211
|
210
|
like($result->one->{key1}, qr/^2010-01-01/);
|
...
|
...
|
@@ -213,7 +212,6 @@ like($result->one->{key1}, qr/^2010-01-01/);
|
213
|
212
|
$dbi = DBIx::Custom->connect;
|
214
|
213
|
eval { $dbi->execute('drop table table1') };
|
215
|
214
|
$dbi->execute($create_table1_type);
|
216
|
|
-$DB::single = 1;
|
217
|
215
|
$dbi->type_rule(
|
218
|
216
|
into1 => [
|
219
|
217
|
[$date_typename, $datetime_typename] => sub {
|
...
|
...
|
@@ -1198,23 +1196,28 @@ test 'transaction1';
|
1198
|
1196
|
$dbi = DBIx::Custom->connect;
|
1199
|
1197
|
eval { $dbi->execute('drop table table1') };
|
1200
|
1198
|
$dbi->execute($create_table1);
|
1201
|
|
-$dbi->dbh->begin_work;
|
|
1199
|
+$dbi->begin_work;
|
|
1200
|
+$dbi->dbh->{AutoCommit} = 0;
|
1202
|
1201
|
$dbi->insert(table => 'table1', param => {key1 => 1, key2 => 2});
|
1203
|
|
-$dbi->insert(table => 'table1', param => {key1 => 2, key2 => 3});
|
1204
|
|
-$dbi->dbh->commit;
|
|
1202
|
+$dbi->rollback;
|
|
1203
|
+$dbi->dbh->{AutoCommit} = 1;
|
|
1204
|
+
|
1205
|
1205
|
$result = $dbi->select(table => 'table1');
|
1206
|
|
-is_deeply(scalar $result->all, [{key1 => 1, key2 => 2}, {key1 => 2, key2 => 3}],
|
1207
|
|
- "commit");
|
|
1206
|
+ok(! $result->fetch_first, "rollback");
|
|
1207
|
+
|
1208
|
1208
|
|
1209
|
1209
|
$dbi = DBIx::Custom->connect;
|
1210
|
1210
|
eval { $dbi->execute('drop table table1') };
|
1211
|
1211
|
$dbi->execute($create_table1);
|
1212
|
|
-$dbi->dbh->begin_work(0);
|
|
1212
|
+$dbi->begin_work;
|
|
1213
|
+$dbi->dbh->{AutoCommit} = 0;
|
1213
|
1214
|
$dbi->insert(table => 'table1', param => {key1 => 1, key2 => 2});
|
1214
|
|
-$dbi->dbh->rollback;
|
1215
|
|
-
|
|
1215
|
+$dbi->insert(table => 'table1', param => {key1 => 2, key2 => 3});
|
|
1216
|
+$dbi->commit;
|
|
1217
|
+$dbi->dbh->{AutoCommit} = 1;
|
1216
|
1218
|
$result = $dbi->select(table => 'table1');
|
1217
|
|
-ok(! $result->fetch_first, "rollback");
|
|
1219
|
+is_deeply(scalar $result->all, [{key1 => 1, key2 => 2}, {key1 => 2, key2 => 3}],
|
|
1220
|
+ "commit");
|
1218
|
1221
|
|
1219
|
1222
|
test 'execute';
|
1220
|
1223
|
eval { $dbi->execute('drop table table1') };
|
...
|
...
|
@@ -3097,7 +3100,6 @@ is_deeply($result->all, [{'table1-key1' => 1, 'table1-key2' => 3},
|
3097
|
3100
|
{'table1-key1' => 2, 'table1-key2' => 2}]);
|
3098
|
3101
|
|
3099
|
3102
|
test 'tag_parse';
|
3100
|
|
-$DB::single = 1;
|
3101
|
3103
|
$dbi = DBIx::Custom->connect;
|
3102
|
3104
|
$dbi->tag_parse(0);
|
3103
|
3105
|
eval { $dbi->execute('drop table table1') };
|