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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5f29fdec
Commit
5f29fdec
authored
Nov 07, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 5.5 into 10.0
parents
9c026273
b68d8a05
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
80 additions
and
32 deletions
+80
-32
client/mysqltest.cc
client/mysqltest.cc
+1
-1
mysql-test/lib/v1/mysql-test-run.pl
mysql-test/lib/v1/mysql-test-run.pl
+1
-1
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+1
-1
mysql-test/r/auto_increment_ranges_innodb.result
mysql-test/r/auto_increment_ranges_innodb.result
+14
-0
mysql-test/t/auto_increment_ranges_innodb.test
mysql-test/t/auto_increment_ranges_innodb.test
+13
-0
mysys/mf_iocache.c
mysys/mf_iocache.c
+4
-0
mysys/my_pread.c
mysys/my_pread.c
+19
-7
mysys/my_read.c
mysys/my_read.c
+26
-22
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-0
No files found.
client/mysqltest.cc
View file @
5f29fdec
...
...
@@ -20,7 +20,7 @@
Tool used for executing a .test file
See the "MySQL Test framework manual" for more information
http
://dev.mysql.com/doc/mysqltest/en/index.html
http
s://mariadb.com/kb/en/library/mysqltest/
Please keep the test framework tools identical in all versions!
...
...
mysql-test/lib/v1/mysql-test-run.pl
View file @
5f29fdec
...
...
@@ -23,7 +23,7 @@
# Tool used for executing a suite of .test file
#
# See the "MySQL Test framework manual" for more information
# http
://dev.mysql.com/doc/mysqltest/en/index.html
# http
s://mariadb.com/kb/en/library/mysqltest/
#
# Please keep the test framework tools identical in all versions!
#
...
...
mysql-test/mysql-test-run.pl
View file @
5f29fdec
...
...
@@ -25,7 +25,7 @@
# Tool used for executing a suite of .test files
#
# See the "MySQL Test framework manual" for more information
# http
://dev.mysql.com/doc/mysqltest/en/index.html
# http
s://mariadb.com/kb/en/library/mysqltest/
#
#
##############################################################################
...
...
mysql-test/r/auto_increment_ranges_innodb.result
View file @
5f29fdec
...
...
@@ -264,3 +264,17 @@ delete from t1 where a=32767;
insert into t1 values(NULL);
ERROR 22003: Out of range value for column 'a' at row 1
drop table t1;
create table t1 (pk int auto_increment primary key, f varchar(20));
insert t1 (f) values ('a'), ('b'), ('c'), ('d');
select null, f into outfile 'load.data' from t1 limit 1;
load data infile 'load.data' into table t1;
insert t1 (f) values ('<===');
select * from t1;
pk f
1 a
2 b
3 c
4 d
5 a
6 <===
drop table t1;
mysql-test/t/auto_increment_ranges_innodb.test
View file @
5f29fdec
...
...
@@ -5,3 +5,16 @@
--
source
include
/
have_innodb
.
inc
set
default_storage_engine
=
innodb
;
--
source
auto_increment_ranges
.
inc
#
# MDEV-17377 invalid gap in auto-increment values after LOAD DATA
#
create
table
t1
(
pk
int
auto_increment
primary
key
,
f
varchar
(
20
));
insert
t1
(
f
)
values
(
'a'
),
(
'b'
),
(
'c'
),
(
'd'
);
select
null
,
f
into
outfile
'load.data'
from
t1
limit
1
;
load
data
infile
'load.data'
into
table
t1
;
insert
t1
(
f
)
values
(
'<==='
);
select
*
from
t1
;
drop
table
t1
;
--
let
$datadir
=
`select @@datadir`
--
remove_file
$datadir
/
test
/
load
.
data
mysys/mf_iocache.c
View file @
5f29fdec
...
...
@@ -282,6 +282,10 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
}
info
->
inited
=
info
->
aio_result
.
pending
=
0
;
#endif
if
(
type
==
READ_CACHE
||
type
==
WRITE_CACHE
||
type
==
SEQ_READ_APPEND
)
info
->
myflags
|=
MY_FULL_IO
;
else
info
->
myflags
&=
~
MY_FULL_IO
;
DBUG_RETURN
(
0
);
}
/* init_io_cache */
...
...
mysys/my_pread.c
View file @
5f29fdec
...
...
@@ -47,8 +47,7 @@
size_t
my_pread
(
File
Filedes
,
uchar
*
Buffer
,
size_t
Count
,
my_off_t
offset
,
myf
MyFlags
)
{
size_t
readbytes
;
int
error
=
0
;
size_t
readbytes
,
save_count
=
0
;
DBUG_ENTER
(
"my_pread"
);
...
...
@@ -66,11 +65,10 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
#else
readbytes
=
pread
(
Filedes
,
Buffer
,
Count
,
offset
);
#endif
error
=
(
readbytes
!=
Count
);
if
(
error
)
if
(
readbytes
!=
Count
)
{
my_errno
=
errno
?
errno
:
-
1
;
my_errno
=
errno
;
if
(
errno
==
0
||
(
readbytes
!=
(
size_t
)
-
1
&&
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))))
my_errno
=
HA_ERR_FILE_TOO_SHORT
;
...
...
@@ -82,6 +80,18 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
(
int
)
readbytes
));
continue
;
/* Interrupted */
}
/* Do a read retry if we didn't get enough data on first read */
if
(
readbytes
!=
(
size_t
)
-
1
&&
readbytes
!=
0
&&
(
MyFlags
&
MY_FULL_IO
))
{
Buffer
+=
readbytes
;
Count
-=
readbytes
;
save_count
+=
readbytes
;
offset
+=
readbytes
;
continue
;
}
if
(
MyFlags
&
(
MY_WME
|
MY_FAE
|
MY_FNABP
))
{
if
(
readbytes
==
(
size_t
)
-
1
)
...
...
@@ -97,8 +107,10 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
DBUG_RETURN
(
MY_FILE_ERROR
);
/* Return with error */
}
if
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))
DBUG_RETURN
(
0
);
/* Read went ok; Return 0 */
DBUG_RETURN
(
readbytes
);
/* purecov: inspected */
readbytes
=
0
;
/* Read went ok; Return 0 */
else
readbytes
+=
save_count
;
DBUG_RETURN
(
readbytes
);
}
}
/* my_pread */
...
...
mysys/my_read.c
View file @
5f29fdec
...
...
@@ -35,17 +35,16 @@
size_t
my_read
(
File
Filedes
,
uchar
*
Buffer
,
size_t
Count
,
myf
MyFlags
)
{
size_t
readbytes
,
save_count
;
size_t
readbytes
,
save_count
=
0
;
DBUG_ENTER
(
"my_read"
);
DBUG_PRINT
(
"my"
,(
"fd: %d Buffer: %p Count: %lu MyFlags: %lu"
,
Filedes
,
Buffer
,
(
ulong
)
Count
,
MyFlags
));
save_count
=
Count
;
if
(
!
(
MyFlags
&
(
MY_WME
|
MY_FAE
|
MY_FNABP
)))
MyFlags
|=
my_global_flags
;
for
(;;)
{
errno
=
0
;
/* Linux, Windows don't reset this on EOF/success */
errno
=
0
;
/* Linux, Windows don't reset this on EOF/success */
#ifdef _WIN32
readbytes
=
my_win_read
(
Filedes
,
Buffer
,
Count
);
#else
...
...
@@ -61,47 +60,52 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
if
(
readbytes
!=
Count
)
{
my_errno
=
errno
;
if
(
errno
==
0
||
(
readbytes
!=
(
size_t
)
-
1
&&
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))))
my_errno
=
HA_ERR_FILE_TOO_SHORT
;
int
got_errno
=
my_errno
=
errno
;
DBUG_PRINT
(
"warning"
,(
"Read only %d bytes off %lu from %d, errno: %d"
,
(
int
)
readbytes
,
(
ulong
)
Count
,
Filedes
,
my_errno
));
got_errno
));
if
(
got_errno
==
0
||
(
readbytes
!=
(
size_t
)
-
1
&&
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))))
my_errno
=
HA_ERR_FILE_TOO_SHORT
;
if
((
readbytes
==
0
||
(
int
)
readbytes
==
-
1
)
&&
errno
==
EINTR
)
{
if
((
readbytes
==
0
||
(
int
)
readbytes
==
-
1
)
&&
got_
errno
==
EINTR
)
{
DBUG_PRINT
(
"debug"
,
(
"my_read() was interrupted and returned %ld"
,
(
long
)
readbytes
));
continue
;
/* Interrupted */
}
/* Do a read retry if we didn't get enough data on first read */
if
(
readbytes
!=
(
size_t
)
-
1
&&
readbytes
!=
0
&&
(
MyFlags
&
MY_FULL_IO
))
{
Buffer
+=
readbytes
;
Count
-=
readbytes
;
save_count
+=
readbytes
;
continue
;
}
if
(
MyFlags
&
(
MY_WME
|
MY_FAE
|
MY_FNABP
))
{
if
(
readbytes
==
(
size_t
)
-
1
)
my_error
(
EE_READ
,
MYF
(
ME_BELL
|
ME_WAITTANG
|
(
MyFlags
&
(
ME_JUST_INFO
|
ME_NOREFRESH
))),
my_filename
(
Filedes
),
my
_errno
);
my_filename
(
Filedes
),
got
_errno
);
else
if
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))
my_error
(
EE_EOFERR
,
MYF
(
ME_BELL
|
ME_WAITTANG
|
(
MyFlags
&
(
ME_JUST_INFO
|
ME_NOREFRESH
))),
my_filename
(
Filedes
),
my
_errno
);
my_filename
(
Filedes
),
got
_errno
);
}
if
(
readbytes
==
(
size_t
)
-
1
||
((
MyFlags
&
(
MY_FNABP
|
MY_NABP
))
&&
!
(
MyFlags
&
MY_FULL_IO
)))
DBUG_RETURN
(
MY_FILE_ERROR
);
/* Return with error */
if
(
readbytes
!=
(
size_t
)
-
1
&&
(
MyFlags
&
MY_FULL_IO
))
{
Buffer
+=
readbytes
;
Count
-=
readbytes
;
continue
;
}
DBUG_RETURN
(
MY_FILE_ERROR
);
/* Return with error */
}
if
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))
readbytes
=
0
;
/* Ok on read */
else
if
(
MyFlags
&
MY_FULL_IO
)
readbytes
=
save_count
;
readbytes
=
0
;
/* Ok on read */
else
readbytes
+
=
save_count
;
break
;
}
DBUG_RETURN
(
readbytes
);
...
...
sql/sql_yacc.yy
View file @
5f29fdec
...
...
@@ -13074,6 +13074,7 @@ load:
lex->field_list.empty();
lex->update_list.empty();
lex->value_list.empty();
lex->many_values.empty();
}
opt_load_data_charset
{ Lex->exchange->cs= $15; }
...
...
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