-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix themdatabaseIssues or pull requests that affect the database layerIssues or pull requests that affect the database layer
Description
PHP Version
7.4
CodeIgniter4 Version
dev
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
No response
What happened?
When passing data to the setInsertBatch() and insertBatch() methods.
- Ignoring batchSize.
- Duplicate field(s) in the query string.
Steps to Reproduce
$db = db_connect();
$set = [
['value' => 1,],
['value' => 2,],
['value' => 3,],
];
$data = [
['value' => 4,],
['value' => 5,],
['value' => 6,],
];
dd($db->table('test')->testMode()->setInsertBatch($set)->insertBatch($data, null, 1));
array (3) [
0 => string (66) "INSERT INTO `db_test` (`value`, `value`) VALUES (1), (2), (3), (4)"
1 => string (42) "INSERT INTO `db_test` (`value`) VALUES (5)"
2 => string (42) "INSERT INTO `db_test` (`value`) VALUES (6)"
]
Expected Output
array (3) [
0 => string (42) "INSERT INTO `db_test` (`value`) VALUES (1)"
1 => string (42) "INSERT INTO `db_test` (`value`) VALUES (2)"
2 => string (42) "INSERT INTO `db_test` (`value`) VALUES (3)"
3 => string (42) "INSERT INTO `db_test` (`value`) VALUES (4)"
4 => string (42) "INSERT INTO `db_test` (`value`) VALUES (5)"
5 => string (42) "INSERT INTO `db_test` (`value`) VALUES (6)"
]
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix themdatabaseIssues or pull requests that affect the database layerIssues or pull requests that affect the database layer