mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/jimw/my/mysql-5.0-clean
This commit is contained in:
commit
fdc16dc434
2 changed files with 27 additions and 11 deletions
|
@ -490,7 +490,7 @@ os_io_init_simple(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
#if !defined(UNIV_HOTBACKUP) && !defined(__NETWARE__)
|
||||
/*************************************************************************
|
||||
Creates a temporary file. This function is defined in ha_innodb.cc. */
|
||||
|
||||
|
@ -498,7 +498,7 @@ int
|
|||
innobase_mysql_tmpfile(void);
|
||||
/*========================*/
|
||||
/* out: temporary file descriptor, or < 0 on error */
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
#endif /* !UNIV_HOTBACKUP && !__NETWARE__ */
|
||||
|
||||
/***************************************************************************
|
||||
Creates a temporary file. */
|
||||
|
@ -508,9 +508,12 @@ os_file_create_tmpfile(void)
|
|||
/*========================*/
|
||||
/* out: temporary file handle, or NULL on error */
|
||||
{
|
||||
#ifdef __NETWARE__
|
||||
FILE* file = tmpfile();
|
||||
#else /* __NETWARE__ */
|
||||
FILE* file = NULL;
|
||||
int fd = -1;
|
||||
#ifdef UNIV_HOTBACKUP
|
||||
# ifdef UNIV_HOTBACKUP
|
||||
int tries;
|
||||
for (tries = 10; tries--; ) {
|
||||
char* name = tempnam(fil_path_to_mysql_datadir, "ib");
|
||||
|
@ -519,15 +522,15 @@ os_file_create_tmpfile(void)
|
|||
}
|
||||
|
||||
fd = open(name,
|
||||
# ifdef __WIN__
|
||||
# ifdef __WIN__
|
||||
O_SEQUENTIAL | O_SHORT_LIVED | O_TEMPORARY |
|
||||
# endif /* __WIN__ */
|
||||
# endif /* __WIN__ */
|
||||
O_CREAT | O_EXCL | O_RDWR,
|
||||
S_IREAD | S_IWRITE);
|
||||
if (fd >= 0) {
|
||||
# ifndef __WIN__
|
||||
# ifndef __WIN__
|
||||
unlink(name);
|
||||
# endif /* !__WIN__ */
|
||||
# endif /* !__WIN__ */
|
||||
free(name);
|
||||
break;
|
||||
}
|
||||
|
@ -538,22 +541,25 @@ os_file_create_tmpfile(void)
|
|||
name);
|
||||
free(name);
|
||||
}
|
||||
#else /* UNIV_HOTBACKUP */
|
||||
# else /* UNIV_HOTBACKUP */
|
||||
fd = innobase_mysql_tmpfile();
|
||||
#endif /* UNIV_HOTBACKUP */
|
||||
# endif /* UNIV_HOTBACKUP */
|
||||
|
||||
if (fd >= 0) {
|
||||
file = fdopen(fd, "w+b");
|
||||
}
|
||||
#endif /* __NETWARE__ */
|
||||
|
||||
if (!file) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Error: unable to create temporary file;"
|
||||
" errno: %d\n", errno);
|
||||
#ifndef __NETWARE__
|
||||
if (fd >= 0) {
|
||||
close(fd);
|
||||
}
|
||||
#endif /* !__NETWARE__ */
|
||||
}
|
||||
|
||||
return(file);
|
||||
|
|
|
@ -5704,7 +5704,9 @@ ha_innobase::store_lock(
|
|||
if ((lock_type == TL_READ && thd->in_lock_tables) ||
|
||||
(lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) ||
|
||||
lock_type == TL_READ_WITH_SHARED_LOCKS ||
|
||||
lock_type == TL_READ_NO_INSERT) {
|
||||
lock_type == TL_READ_NO_INSERT ||
|
||||
thd->lex->sql_command != SQLCOM_SELECT) {
|
||||
|
||||
/* The OR cases above are in this order:
|
||||
1) MySQL is doing LOCK TABLES ... READ LOCAL, or
|
||||
2) (we do not know when TL_READ_HIGH_PRIORITY is used), or
|
||||
|
@ -5712,7 +5714,15 @@ ha_innobase::store_lock(
|
|||
4) we are doing a complex SQL statement like
|
||||
INSERT INTO ... SELECT ... and the logical logging (MySQL
|
||||
binlog) requires the use of a locking read, or
|
||||
MySQL is doing LOCK TABLES ... READ. */
|
||||
MySQL is doing LOCK TABLES ... READ.
|
||||
5) we let InnoDB do locking reads for all SQL statements that
|
||||
are not simple SELECTs; note that select_lock_type in this
|
||||
case may get strengthened in ::external_lock() to LOCK_X.
|
||||
Note that we MUST use a locking read in all data modifying
|
||||
SQL statements, because otherwise the execution would not be
|
||||
serializable, and also the results from the update could be
|
||||
unexpected if an obsolete consistent read view would be
|
||||
used. */
|
||||
|
||||
prebuilt->select_lock_type = LOCK_S;
|
||||
prebuilt->stored_select_lock_type = LOCK_S;
|
||||
|
|
Loading…
Reference in a new issue