Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.5.8
-
MariaDB 10.5.4
Windows 10 64 bits
Description
CREATE TABLE `table1` (
|
`id` int(11) DEFAULT NULL, |
`name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL |
) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=1; |
|
CREATE TABLE `table2` (
|
`id` int(11) DEFAULT NULL, |
`name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL |
) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=1; |
|
CREATE TRIGGER `table1_before_insert` BEFORE INSERT ON `table1`
|
FOR EACH ROW BEGIN
|
insert into table2(`id`, `name`) values (NEW.`id`, NEW.`name`);
|
END
|
import mariadb |
conn=mariadb.connect(user="test", database="test") |
cursor=conn.cursor()
|
vals = [(1,'John'), (2,'Smith'), (3,'Carol')] |
cursor.executemany("INSERT INTO table1 VALUES (?,?)", vals) |
cursor.execute("SELECT * FROM table1") |
rows= cursor.fetchall()
|
print(rows)
|
Expected output:
[(1, 'John', 1, 'John'), (2, 'Smith', 1, 'John'), (3, 'Carol', 1, 'John'), (1, 'John', 2, 'Smith'), (2, 'Smith', 2, 'Smith'), (3, 'Carol', 2, 'Smith'), (1, 'John', 3, 'Carol'), (2, 'Smith', 3, 'Carol'), (3, 'Carol', 3, 'Carol')]
Current output:
[(1, 'John', 1, 'John'), (1, 'John', 1, 'John')]
Expected rows on tables:
Table1:
"1" "John"
"2" "Smith"
"3" "Carol"
Table2:
"1" "John"
"2" "Smith"
"3" "Carol"
Current rows on tables:
Table1:
"1" "John"
Table2:
"1" "John"
"1" "John"
Running insert on mariadb console, works correctly:
insert into Table1 values(1,'John'),(2,'Smith'),(3,'Carol');
Attachments
Issue Links
- causes
-
CONJ-1086 Batch insert inserts only the first row when there is a trigger
-
- Closed
-
-
CONJS-182 Batch inserts with duplicate treatment only perform 1 insert
-
- Closed
-
- relates to
-
MDEV-34958 after Trigger doesn't work correctly with bulk insert
-
- Closed
-
- split to
-
MDEV-34718 Trigger doesn't work correctly with bulk update
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
{code:java} CREATE TABLE `table1` ( `id` int(11) DEFAULT NULL, `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=1 CREATE TABLE `table2` ( `id` int(11) DEFAULT NULL, `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=1 CREATE TRIGGER `table1_before_insert` BEFORE INSERT ON `table1` FOR EACH ROW BEGIN insert into table2(`id`, `name`) values (NEW.`id`, NEW.`name`); END {code} {code:java} import mariadb conn=mariadb.connect(user="test", database="test") cursor=conn.cursor() vals = [(1,'John'), (2,'Smith'), (3,'Carol')] cursor.executemany("INSERT INTO table1 VALUES (?,?)", vals) cursor.execute("SELECT * FROM table1") rows= cursor.fetchall() print(rows) {code} *Expected output:* [(1, 'John', 1, 'John'), (2, 'Smith', 1, 'John'), (3, 'Carol', 1, 'John'), (1, 'John', 2, 'Smith'), (2, 'Smith', 2, 'Smith'), (3, 'Carol', 2, 'Smith'), (1, 'John', 3, 'Carol'), (2, 'Smith', 3, 'Carol'), (3, 'Carol', 3, 'Carol')] *Current output:* [(1, 'John', 1, 'John'), (1, 'John', 1, 'John')] *Expected rows on tables:* Table1: "1" "John" "2" "Smith" "3" "Carol" Table2: "1" "John" "2" "Smith" "3" "Carol" *Current rows on tables:* Table1: "1" "John" Table2: "1" "John" "1" "John" +Running insert on mariadb console, works correctly: insert into Table1 values(1,'John'),(2,'Smith'),(3,'Carol'); |
{code:java}
CREATE TABLE `table1` ( `id` int(11) DEFAULT NULL, `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=1; CREATE TABLE `table2` ( `id` int(11) DEFAULT NULL, `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=1; CREATE TRIGGER `table1_before_insert` BEFORE INSERT ON `table1` FOR EACH ROW BEGIN insert into table2(`id`, `name`) values (NEW.`id`, NEW.`name`); END {code} {code:java} import mariadb conn=mariadb.connect(user="test", database="test") cursor=conn.cursor() vals = [(1,'John'), (2,'Smith'), (3,'Carol')] cursor.executemany("INSERT INTO table1 VALUES (?,?)", vals) cursor.execute("SELECT * FROM table1") rows= cursor.fetchall() print(rows) {code} *Expected output:* [(1, 'John', 1, 'John'), (2, 'Smith', 1, 'John'), (3, 'Carol', 1, 'John'), (1, 'John', 2, 'Smith'), (2, 'Smith', 2, 'Smith'), (3, 'Carol', 2, 'Smith'), (1, 'John', 3, 'Carol'), (2, 'Smith', 3, 'Carol'), (3, 'Carol', 3, 'Carol')] *Current output:* [(1, 'John', 1, 'John'), (1, 'John', 1, 'John')] *Expected rows on tables:* Table1: "1" "John" "2" "Smith" "3" "Carol" Table2: "1" "John" "2" "Smith" "3" "Carol" *Current rows on tables:* Table1: "1" "John" Table2: "1" "John" "1" "John" +Running insert on mariadb console, works correctly:+ insert into Table1 values(1,'John'),(2,'Smith'),(3,'Carol'); |
Component/s | Binary Protocol [ 16120 ] | |
Component/s | Other [ 16504 ] | |
Key |
|
|
Affects Version/s | 10.5.8 [ 25023 ] | |
Affects Version/s | 1.0.5 [ 25126 ] | |
Project | MariaDB Connector/Python [ 11400 ] | MariaDB Server [ 10000 ] |
Assignee | Georg Richter [ georg ] | Oleksandr Byelkin [ sanja ] |
Priority | Critical [ 2 ] | Blocker [ 1 ] |
Priority | Blocker [ 1 ] | Critical [ 2 ] |
Summary | Trigger doesn't work correctly with executemany | Trigger doesn't work correctly with bulk insert |
Fix Version/s | 10.5 [ 23123 ] |
Labels | CONNECTOR_RELATED |
Labels | CONNECTOR_RELATED |
Status | Open [ 1 ] | In Progress [ 3 ] |
Workflow | MariaDB v3 [ 116872 ] | MariaDB v4 [ 144580 ] |
Labels | CONNECTOR_RELATED |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Dmitry Shulga [ JIRAUSER47315 ] |
Fix Version/s | 10.2 [ 14601 ] |
Priority | Critical [ 2 ] | Major [ 3 ] |
Fix Version/s | 10.7 [ 24805 ] |
Fix Version/s | 10.3 [ 22126 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Assignee | Dmitry Shulga [ JIRAUSER47315 ] | Pandikrishnan Gurusamy [ JIRAUSER52131 ] |
Assignee | Pandikrishnan Gurusamy [ JIRAUSER52131 ] | Oleksandr Byelkin [ sanja ] |
Priority | Critical [ 2 ] | Blocker [ 1 ] |
Priority | Blocker [ 1 ] | Critical [ 2 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Dmitry Shulga [ JIRAUSER47315 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Dmitry Shulga [ JIRAUSER47315 ] | Oleksandr Byelkin [ sanja ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Dmitry Shulga [ JIRAUSER47315 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.5.26 [ 29832 ] | |
Fix Version/s | 10.6.19 [ 29833 ] | |
Fix Version/s | 10.11.9 [ 29834 ] | |
Fix Version/s | 11.1.6 [ 29835 ] | |
Fix Version/s | 11.2.5 [ 29836 ] | |
Fix Version/s | 11.4.3 [ 29837 ] | |
Fix Version/s | 11.5.2 [ 29838 ] | |
Fix Version/s | 11.6.0 [ 29839 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Zendesk Related Tickets | 201572 | |
Zendesk active tickets | 201572 |
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Link |
This issue split to |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Link |
This issue relates to |