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
233be9c2
Commit
233be9c2
authored
Jun 26, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.0
into deer.(none):/home/hf/work/mysql-4.0.615
parents
349946b3
3148d6f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
4 deletions
+28
-4
mysql-test/r/insert.result
mysql-test/r/insert.result
+10
-0
mysql-test/t/insert.test
mysql-test/t/insert.test
+12
-0
sql/field.h
sql/field.h
+4
-2
sql/field_conv.cc
sql/field_conv.cc
+2
-2
No files found.
mysql-test/r/insert.result
View file @
233be9c2
...
...
@@ -58,6 +58,16 @@ skr 2
test 1
test 2
drop table t1;
create table t1 (id int NOT NULL DEFAULT 8);
insert into t1 values(NULL);
Column 'id' cannot be null
insert into t1 values (1), (NULL), (2);
select * from t1;
id
1
8
2
drop table t1;
drop database if exists foo;
create database foo;
use foo;
...
...
mysql-test/t/insert.test
View file @
233be9c2
...
...
@@ -50,6 +50,17 @@ insert into t1 values ('rts',NULL),('rts',NULL),('test',NULL);
select
*
from
t1
;
drop
table
t1
;
#
#Test of behaviour with INSERT VALUES (NULL)
#
create
table
t1
(
id
int
NOT
NULL
DEFAULT
8
);
--
error
1048
insert
into
t1
values
(
NULL
);
insert
into
t1
values
(
1
),
(
NULL
),
(
2
);
select
*
from
t1
;
drop
table
t1
;
#
# Test of mysqld crash with fully qualified column names
#
...
...
@@ -60,3 +71,4 @@ use foo;
create
table
t1
(
c
int
);
insert
into
foo
.
t1
set
foo
.
t1
.
c
=
'1'
;
drop
database
foo
;
sql/field.h
View file @
233be9c2
...
...
@@ -72,10 +72,12 @@ public:
virtual
void
reset_fields
()
{}
virtual
void
set_default
()
{
memcpy
(
ptr
,
ptr
+
table
->
rec_buff_length
,
pack_length
());
my_ptrdiff_t
offset
=
(
my_ptrdiff_t
)
(
table
->
record
[
2
]
-
table
->
record
[
0
]);
memcpy
(
ptr
,
ptr
+
offset
,
pack_length
());
if
(
null_ptr
)
*
null_ptr
=
((
*
null_ptr
&
(
uchar
)
~
null_bit
)
|
null_ptr
[
table
->
rec_buff_length
]
&
null_bit
);
null_ptr
[
offset
]
&
null_bit
);
}
virtual
bool
binary
()
const
{
return
1
;
}
virtual
bool
zero_pack
()
const
{
return
1
;
}
...
...
sql/field_conv.cc
View file @
233be9c2
...
...
@@ -118,7 +118,7 @@ set_field_to_null(Field *field)
field
->
reset
();
return
0
;
}
field
->
rese
t
();
field
->
set_defaul
t
();
if
(
current_thd
->
count_cuted_fields
)
{
current_thd
->
cuted_fields
++
;
// Increment error counter
...
...
@@ -170,7 +170,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
((
Field_timestamp
*
)
field
)
->
set_time
();
return
0
;
// Ok to set time to NULL
}
field
->
rese
t
();
field
->
set_defaul
t
();
if
(
field
==
field
->
table
->
next_number_field
)
return
0
;
// field is set in handler.cc
if
(
current_thd
->
count_cuted_fields
)
...
...
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