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
b5a9dd14
Commit
b5a9dd14
authored
Jan 14, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/my/mysql-4.0 into mashka.mysql.fi:/home/my/mysql-4.0
parents
2e4cc470
ef6c36c0
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
146 additions
and
3 deletions
+146
-3
include/my_global.h
include/my_global.h
+7
-0
include/my_pthread.h
include/my_pthread.h
+6
-2
mysql-test/r/null.result
mysql-test/r/null.result
+36
-0
mysql-test/r/rpl_loaddata.result
mysql-test/r/rpl_loaddata.result
+13
-0
mysql-test/std_data/rpl_loaddata.dat
mysql-test/std_data/rpl_loaddata.dat
+2
-0
mysql-test/t/null.test
mysql-test/t/null.test
+31
-0
mysql-test/t/rpl_loaddata.test
mysql-test/t/rpl_loaddata.test
+16
-0
mysql-test/t/rpl_log-master.opt
mysql-test/t/rpl_log-master.opt
+1
-0
sql/field_conv.cc
sql/field_conv.cc
+9
-0
sql/sql_load.cc
sql/sql_load.cc
+25
-1
No files found.
include/my_global.h
View file @
b5a9dd14
...
...
@@ -153,6 +153,13 @@ C_MODE_END
#undef HAVE_INITGROUPS
#endif
/* gcc/egcs issues */
#if defined(__GNUC) && defined(__EXCEPTIONS)
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
#endif
/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */
#if SIZEOF_LONG == 4 && defined(__LONG_MAX__)
#undef __LONG_MAX__
/* Is a longlong value in gcc 2.8.0 ??? */
...
...
include/my_pthread.h
View file @
b5a9dd14
...
...
@@ -581,9 +581,13 @@ extern int pthread_dummy(int);
#define THREAD_NAME_SIZE 10
#if defined(__ia64__)
#define DEFAULT_THREAD_STACK (128*1024)
/*
MySQL can survive with 32K, but some glibc libraries require > 128K stack
To resolve hostnames
*/
#define DEFAULT_THREAD_STACK (192*1024L)
#else
#define DEFAULT_THREAD_STACK (
64*1024
)
#define DEFAULT_THREAD_STACK (
192*1024L
)
#endif
struct
st_my_thread_var
...
...
mysql-test/r/null.result
View file @
b5a9dd14
...
...
@@ -73,3 +73,39 @@ b ifnull(t2.b,"this is null")
NULL this is null
NULL this is null
drop table t1;
CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL);
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
UPDATE t1 SET d=1/NULL;
UPDATE t1 SET d=NULL;
INSERT INTO t1 (a) values (null);
Column 'a' cannot be null
INSERT INTO t1 (a) values (1/null);
Column 'a' cannot be null
INSERT INTO t1 (a) values (null),(null);
INSERT INTO t1 (b) values (null);
Column 'b' cannot be null
INSERT INTO t1 (b) values (1/null);
Column 'b' cannot be null
INSERT INTO t1 (b) values (null),(null);
INSERT INTO t1 (c) values (null);
Column 'c' cannot be null
INSERT INTO t1 (c) values (1/null);
Column 'c' cannot be null
INSERT INTO t1 (c) values (null),(null);
INSERT INTO t1 (d) values (null);
Column 'd' cannot be null
INSERT INTO t1 (d) values (1/null);
Column 'd' cannot be null
INSERT INTO t1 (d) values (null),(null);
select * from t1;
a b c d
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
drop table t1;
mysql-test/r/rpl_loaddata.result
0 → 100644
View file @
b5a9dd14
slave stop;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
create table t1(a int not null auto_increment, b int, primary key(a) );
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
select * from t1;
a b
1 10
2 15
drop table t1;
mysql-test/std_data/rpl_loaddata.dat
0 → 100644
View file @
b5a9dd14
\N 10
\N 15
mysql-test/t/null.test
View file @
b5a9dd14
...
...
@@ -48,3 +48,34 @@ insert into t1 values(10,null);
select
t2
.
b
,
ifnull
(
t2
.
b
,
"this is null"
)
from
t1
as
t2
left
join
t1
as
t3
on
t2
.
b
=
t3
.
a
order
by
1
;
drop
table
t1
;
#
# Test inserting and updating with NULL
#
CREATE
TABLE
t1
(
a
varchar
(
16
)
NOT
NULL
,
b
smallint
(
6
)
NOT
NULL
,
c
datetime
NOT
NULL
,
d
smallint
(
6
)
NOT
NULL
);
INSERT
INTO
t1
SET
a
=
""
,
d
=
"2003-01-14 03:54:55"
;
UPDATE
t1
SET
d
=
1
/
NULL
;
UPDATE
t1
SET
d
=
NULL
;
--
error
1048
INSERT
INTO
t1
(
a
)
values
(
null
);
--
error
1048
INSERT
INTO
t1
(
a
)
values
(
1
/
null
);
INSERT
INTO
t1
(
a
)
values
(
null
),(
null
);
--
error
1048
INSERT
INTO
t1
(
b
)
values
(
null
);
--
error
1048
INSERT
INTO
t1
(
b
)
values
(
1
/
null
);
INSERT
INTO
t1
(
b
)
values
(
null
),(
null
);
--
error
1048
INSERT
INTO
t1
(
c
)
values
(
null
);
--
error
1048
INSERT
INTO
t1
(
c
)
values
(
1
/
null
);
INSERT
INTO
t1
(
c
)
values
(
null
),(
null
);
--
error
1048
INSERT
INTO
t1
(
d
)
values
(
null
);
--
error
1048
INSERT
INTO
t1
(
d
)
values
(
1
/
null
);
INSERT
INTO
t1
(
d
)
values
(
null
),(
null
);
select
*
from
t1
;
drop
table
t1
;
mysql-test/t/rpl_loaddata.test
0 → 100644
View file @
b5a9dd14
# See if replication of a "LOAD DATA in an autoincrement column"
# Honours autoincrement values
# i.e. if the master and slave have the same sequence
source
include
/
master
-
slave
.
inc
;
create
table
t1
(
a
int
not
null
auto_increment
,
b
int
,
primary
key
(
a
)
);
load
data
infile
'../../std_data/rpl_loaddata.dat'
into
table
t1
;
save_master_pos
;
connection
slave
;
sync_with_master
;
select
*
from
t1
;
connection
master
;
drop
table
t1
;
save_master_pos
;
connection
slave
;
sync_with_master
;
mysql-test/t/rpl_log-master.opt
0 → 100644
View file @
b5a9dd14
--skip-external-locking
sql/field_conv.cc
View file @
b5a9dd14
...
...
@@ -118,6 +118,15 @@ set_field_to_null(Field *field)
field
->
reset
();
return
0
;
}
field
->
reset
();
if
(
current_thd
->
count_cuted_fields
)
{
current_thd
->
cuted_fields
++
;
// Increment error counter
return
0
;
}
if
(
!
current_thd
->
no_errors
)
my_printf_error
(
ER_BAD_NULL_ERROR
,
ER
(
ER_BAD_NULL_ERROR
),
MYF
(
0
),
field
->
field_name
);
return
1
;
}
...
...
sql/sql_load.cc
View file @
b5a9dd14
...
...
@@ -357,8 +357,10 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List<Item> &fields,
{
List_iterator_fast
<
Item
>
it
(
fields
);
Item_field
*
sql_field
;
ulonglong
id
;
DBUG_ENTER
(
"read_fixed_length"
);
id
=
0
;
/* No fields can be null in this format. mark all fields as not null */
while
((
sql_field
=
(
Item_field
*
)
it
++
))
sql_field
->
field
->
set_notnull
();
...
...
@@ -401,6 +403,14 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List<Item> &fields,
thd
->
cuted_fields
++
;
/* To long row */
if
(
write_record
(
table
,
&
info
))
DBUG_RETURN
(
1
);
/*
If auto_increment values are used, save the first one
for LAST_INSERT_ID() and for the binary/update log.
We can't use insert_id() as we don't want to touch the
last_insert_id_used flag.
*/
if
(
!
id
&&
thd
->
insert_id_used
)
id
=
thd
->
last_insert_id
;
if
(
table
->
next_number_field
)
table
->
next_number_field
->
reset
();
// Clear for next record
if
(
read_info
.
next_line
())
// Skip to next line
...
...
@@ -408,6 +418,8 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List<Item> &fields,
if
(
read_info
.
line_cuted
)
thd
->
cuted_fields
++
;
/* To long row */
}
if
(
id
&&
!
read_info
.
error
)
thd
->
insert_id
(
id
);
// For binary/update log
DBUG_RETURN
(
test
(
read_info
.
error
));
}
...
...
@@ -421,9 +433,11 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table,
List_iterator_fast
<
Item
>
it
(
fields
);
Item_field
*
sql_field
;
uint
enclosed_length
;
ulonglong
id
;
DBUG_ENTER
(
"read_sep_field"
);
enclosed_length
=
enclosed
.
length
();
id
=
0
;
for
(;;
it
.
rewind
())
{
...
...
@@ -477,6 +491,14 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table,
}
if
(
write_record
(
table
,
&
info
))
DBUG_RETURN
(
1
);
/*
If auto_increment values are used, save the first one
for LAST_INSERT_ID() and for the binary/update log.
We can't use insert_id() as we don't want to touch the
last_insert_id_used flag.
*/
if
(
!
id
&&
thd
->
insert_id_used
)
id
=
thd
->
last_insert_id
;
if
(
table
->
next_number_field
)
table
->
next_number_field
->
reset
();
// Clear for next record
if
(
read_info
.
next_line
())
// Skip to next line
...
...
@@ -484,6 +506,8 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table,
if
(
read_info
.
line_cuted
)
thd
->
cuted_fields
++
;
/* To long row */
}
if
(
id
&&
!
read_info
.
error
)
thd
->
insert_id
(
id
);
// For binary/update log
DBUG_RETURN
(
test
(
read_info
.
error
));
}
...
...
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