Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
51e47e13
Commit
51e47e13
authored
Feb 22, 2010
by
Tatiana A. Nurnberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert 48525
parent
0a992ff5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
55 deletions
+9
-55
mysql-test/r/trigger.result
mysql-test/r/trigger.result
+0
-17
mysql-test/t/trigger.test
mysql-test/t/trigger.test
+0
-13
sql/field_conv.cc
sql/field_conv.cc
+8
-18
sql/sp_head.cc
sql/sp_head.cc
+0
-1
sql/sql_class.cc
sql/sql_class.cc
+0
-4
sql/sql_class.h
sql/sql_class.h
+0
-1
sql/sql_insert.cc
sql/sql_insert.cc
+1
-1
No files found.
mysql-test/r/trigger.result
View file @
51e47e13
...
@@ -2087,21 +2087,4 @@ ERROR 42S02: Table 'test.a_nonextisting_table' doesn't exist
...
@@ -2087,21 +2087,4 @@ ERROR 42S02: Table 'test.a_nonextisting_table' doesn't exist
SELECT * FROM t2;
SELECT * FROM t2;
a b
a b
DROP TABLE t1, t2;
DROP TABLE t1, t2;
CREATE TABLE t1 (id INT NOT NULL);
CREATE TABLE t2 (id INT NOT NULL);
INSERT t1 VALUES (1),(2),(3);
UPDATE t1 SET id=NULL;
Warnings:
Warning 1048 Column 'id' cannot be null
Warning 1048 Column 'id' cannot be null
Warning 1048 Column 'id' cannot be null
CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
INSERT INTO t2 VALUES (3);
UPDATE t1 SET id=NULL;
Warnings:
Warning 1048 Column 'id' cannot be null
Warning 1048 Column 'id' cannot be null
Warning 1048 Column 'id' cannot be null
DROP TRIGGER t1_bu;
DROP TABLE t1,t2;
End of 5.1 tests.
End of 5.1 tests.
mysql-test/t/trigger.test
View file @
51e47e13
...
@@ -2396,17 +2396,4 @@ SELECT * FROM t2;
...
@@ -2396,17 +2396,4 @@ SELECT * FROM t2;
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
#
# Bug #48525: trigger changes "Column 'id' cannot be null" behaviour
#
CREATE
TABLE
t1
(
id
INT
NOT
NULL
);
CREATE
TABLE
t2
(
id
INT
NOT
NULL
);
INSERT
t1
VALUES
(
1
),(
2
),(
3
);
UPDATE
t1
SET
id
=
NULL
;
CREATE
TRIGGER
t1_bu
BEFORE
UPDATE
ON
t1
FOR
EACH
ROW
INSERT
INTO
t2
VALUES
(
3
);
UPDATE
t1
SET
id
=
NULL
;
DROP
TRIGGER
t1_bu
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.1
tests
.
--
echo
End
of
5.1
tests
.
sql/field_conv.cc
View file @
51e47e13
...
@@ -122,18 +122,13 @@ set_field_to_null(Field *field)
...
@@ -122,18 +122,13 @@ set_field_to_null(Field *field)
return
0
;
return
0
;
}
}
field
->
reset
();
field
->
reset
();
switch
(
field
->
table
->
in_use
->
count_cuted_fields
)
{
if
(
field
->
table
->
in_use
->
count_cuted_fields
==
CHECK_FIELD_WARN
)
case
CHECK_FIELD_WARN
:
{
field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
/* fall through */
case
CHECK_FIELD_IGNORE
:
return
0
;
return
0
;
case
CHECK_FIELD_ERROR_FOR_NULL
:
if
(
!
field
->
table
->
in_use
->
no_errors
)
my_error
(
ER_BAD_NULL_ERROR
,
MYF
(
0
),
field
->
field_name
);
return
-
1
;
}
}
DBUG_ASSERT
(
0
);
// impossible
if
(
!
field
->
table
->
in_use
->
no_errors
)
my_error
(
ER_BAD_NULL_ERROR
,
MYF
(
0
),
field
->
field_name
);
return
-
1
;
return
-
1
;
}
}
...
@@ -183,18 +178,13 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
...
@@ -183,18 +178,13 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
field
->
table
->
auto_increment_field_not_null
=
FALSE
;
field
->
table
->
auto_increment_field_not_null
=
FALSE
;
return
0
;
// field is set in fill_record()
return
0
;
// field is set in fill_record()
}
}
switch
(
field
->
table
->
in_use
->
count_cuted_fields
)
{
if
(
field
->
table
->
in_use
->
count_cuted_fields
==
CHECK_FIELD_WARN
)
case
CHECK_FIELD_WARN
:
{
field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_BAD_NULL_ERROR
,
1
);
field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_BAD_NULL_ERROR
,
1
);
/* fall through */
case
CHECK_FIELD_IGNORE
:
return
0
;
return
0
;
case
CHECK_FIELD_ERROR_FOR_NULL
:
if
(
!
field
->
table
->
in_use
->
no_errors
)
my_error
(
ER_BAD_NULL_ERROR
,
MYF
(
0
),
field
->
field_name
);
return
-
1
;
}
}
DBUG_ASSERT
(
0
);
// impossible
if
(
!
field
->
table
->
in_use
->
no_errors
)
my_error
(
ER_BAD_NULL_ERROR
,
MYF
(
0
),
field
->
field_name
);
return
-
1
;
return
-
1
;
}
}
...
...
sql/sp_head.cc
View file @
51e47e13
...
@@ -3009,7 +3009,6 @@ int
...
@@ -3009,7 +3009,6 @@ int
sp_instr_set_trigger_field
::
execute
(
THD
*
thd
,
uint
*
nextp
)
sp_instr_set_trigger_field
::
execute
(
THD
*
thd
,
uint
*
nextp
)
{
{
DBUG_ENTER
(
"sp_instr_set_trigger_field::execute"
);
DBUG_ENTER
(
"sp_instr_set_trigger_field::execute"
);
thd
->
count_cuted_fields
=
CHECK_FIELD_ERROR_FOR_NULL
;
DBUG_RETURN
(
m_lex_keeper
.
reset_lex_and_exec_core
(
thd
,
nextp
,
TRUE
,
this
));
DBUG_RETURN
(
m_lex_keeper
.
reset_lex_and_exec_core
(
thd
,
nextp
,
TRUE
,
this
));
}
}
...
...
sql/sql_class.cc
View file @
51e47e13
...
@@ -3100,7 +3100,6 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
...
@@ -3100,7 +3100,6 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
}
}
#endif
#endif
backup
->
count_cuted_fields
=
count_cuted_fields
;
backup
->
options
=
options
;
backup
->
options
=
options
;
backup
->
in_sub_stmt
=
in_sub_stmt
;
backup
->
in_sub_stmt
=
in_sub_stmt
;
backup
->
enable_slow_log
=
enable_slow_log
;
backup
->
enable_slow_log
=
enable_slow_log
;
...
@@ -3138,7 +3137,6 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
...
@@ -3138,7 +3137,6 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
void
THD
::
restore_sub_statement_state
(
Sub_statement_state
*
backup
)
void
THD
::
restore_sub_statement_state
(
Sub_statement_state
*
backup
)
{
{
DBUG_ENTER
(
"THD::restore_sub_statement_state"
);
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
/* BUG#33029, if we are replicating from a buggy master, restore
/* BUG#33029, if we are replicating from a buggy master, restore
auto_inc_intervals_forced so that the top statement can use the
auto_inc_intervals_forced so that the top statement can use the
...
@@ -3165,7 +3163,6 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
...
@@ -3165,7 +3163,6 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
/* ha_release_savepoint() never returns error. */
/* ha_release_savepoint() never returns error. */
(
void
)
ha_release_savepoint
(
this
,
sv
);
(
void
)
ha_release_savepoint
(
this
,
sv
);
}
}
count_cuted_fields
=
backup
->
count_cuted_fields
;
transaction
.
savepoints
=
backup
->
savepoints
;
transaction
.
savepoints
=
backup
->
savepoints
;
options
=
backup
->
options
;
options
=
backup
->
options
;
in_sub_stmt
=
backup
->
in_sub_stmt
;
in_sub_stmt
=
backup
->
in_sub_stmt
;
...
@@ -3195,7 +3192,6 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
...
@@ -3195,7 +3192,6 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
*/
*/
examined_row_count
+=
backup
->
examined_row_count
;
examined_row_count
+=
backup
->
examined_row_count
;
cuted_fields
+=
backup
->
cuted_fields
;
cuted_fields
+=
backup
->
cuted_fields
;
DBUG_VOID_RETURN
;
}
}
...
...
sql/sql_class.h
View file @
51e47e13
...
@@ -995,7 +995,6 @@ public:
...
@@ -995,7 +995,6 @@ public:
bool
enable_slow_log
;
bool
enable_slow_log
;
bool
last_insert_id_used
;
bool
last_insert_id_used
;
SAVEPOINT
*
savepoints
;
SAVEPOINT
*
savepoints
;
enum
enum_check_fields
count_cuted_fields
;
};
};
...
...
sql/sql_insert.cc
View file @
51e47e13
...
@@ -3158,7 +3158,7 @@ bool select_insert::send_data(List<Item> &values)
...
@@ -3158,7 +3158,7 @@ bool select_insert::send_data(List<Item> &values)
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// Calculate cuted fields
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// Calculate cuted fields
store_values
(
values
);
store_values
(
values
);
thd
->
count_cuted_fields
=
CHECK_FIELD_
ERROR_FOR_NULL
;
thd
->
count_cuted_fields
=
CHECK_FIELD_
IGNORE
;
if
(
thd
->
is_error
())
if
(
thd
->
is_error
())
{
{
table
->
auto_increment_field_not_null
=
FALSE
;
table
->
auto_increment_field_not_null
=
FALSE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment