mirror of
https://github.com/MariaDB/server.git
synced 2026-05-02 13:15:32 +02:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into mc05.(none):/space2/tomas/mysql-4.1-ndb-test
This commit is contained in:
commit
4971ce3ec2
24 changed files with 107 additions and 42 deletions
|
|
@ -203,6 +203,15 @@
|
|||
/* If we want to have query cache */
|
||||
#undef HAVE_QUERY_CACHE
|
||||
|
||||
/* Spatial extentions */
|
||||
#undef HAVE_SPATIAL
|
||||
|
||||
/* RTree keys */
|
||||
#undef HAVE_RTREE_KEYS
|
||||
|
||||
/* Access checks in embedded library */
|
||||
#undef HAVE_EMBEDDED_PRIVILEGE_CONTROL
|
||||
|
||||
/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines
|
||||
this with 8 arguments */
|
||||
#undef HAVE_SOLARIS_STYLE_GETHOST
|
||||
|
|
|
|||
29
configure.in
29
configure.in
|
|
@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
|
|||
AC_INIT(sql/mysqld.cc)
|
||||
AC_CANONICAL_SYSTEM
|
||||
# The Docs Makefile.am parses this line!
|
||||
AM_INIT_AUTOMAKE(mysql, 4.1.2-alpha)
|
||||
AM_INIT_AUTOMAKE(mysql, 4.1.3-beta)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
|
@ -26,7 +26,7 @@ MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
|
|||
AVAILABLE_LANGUAGES="\
|
||||
czech danish dutch english estonian french german greek hungarian \
|
||||
italian japanese korean norwegian norwegian-ny polish portuguese \
|
||||
romanian russian slovak spanish swedish ukrainian"
|
||||
romanian russian serbian slovak spanish swedish ukrainian"
|
||||
|
||||
# Generate make rules for all error messages
|
||||
AVAILABLE_LANGUAGES_ERRORS=
|
||||
|
|
@ -2136,6 +2136,31 @@ then
|
|||
AC_DEFINE(HAVE_QUERY_CACHE)
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(geometry,
|
||||
[ --without-geometry Do not build geometry-related parts.],
|
||||
[with_geometry=$withval],
|
||||
[with_geometry=yes]
|
||||
)
|
||||
|
||||
if test "$with_geometry" = "yes"
|
||||
then
|
||||
AC_DEFINE(HAVE_SPATIAL)
|
||||
AC_DEFINE(HAVE_RTREE_KEYS)
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(embedded_privilege_control,
|
||||
[ --with-embedded-privilege-control
|
||||
Build parts to check user's privileges.
|
||||
Only affects embedded library.],
|
||||
[with_embedded_privilege_control=$withval],
|
||||
[with_embedded_privilege_control=no]
|
||||
)
|
||||
|
||||
if test "$with_embedded_privilege_control" = "yes"
|
||||
then
|
||||
AC_DEFINE(HAVE_EMBEDDED_PRIVILEGE_CONTROL)
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(extra-tools,
|
||||
[ --without-extra-tools Skip building utilites in the tools directory.],
|
||||
[with_tools=$withval],
|
||||
|
|
|
|||
|
|
@ -1194,6 +1194,8 @@ do { doubleget_union _tmp; \
|
|||
#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
|
||||
#endif
|
||||
|
||||
#define HAVE_SPATIAL
|
||||
#define HAVE_RTREE_KEYS
|
||||
#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL)
|
||||
#define NO_EMBEDDED_ACCESS_CHECKS
|
||||
#endif
|
||||
|
||||
#endif /* my_global_h */
|
||||
|
|
|
|||
|
|
@ -387,22 +387,19 @@ os_file_lock(
|
|||
/*=========*/
|
||||
/* out: 0 on success */
|
||||
int fd, /* in: file descriptor */
|
||||
const char* name, /* in: file name */
|
||||
uint lock_type) /* in: lock_type */
|
||||
const char* name) /* in: file name */
|
||||
{
|
||||
struct flock lk;
|
||||
lk.l_type = lock_type;
|
||||
lk.l_type = F_WRLCK;
|
||||
lk.l_whence = SEEK_SET;
|
||||
lk.l_start = lk.l_len = 0;
|
||||
if (fcntl(fd, F_SETLK, &lk) == -1) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Unable to lock %s with lock %d, error: %d",
|
||||
name, lock_type, errno);
|
||||
perror (": fcntl");
|
||||
"InnoDB: Unable to lock %s, error: %d", name, errno);
|
||||
close(fd);
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
return(0);
|
||||
}
|
||||
#endif /* USE_FILE_LOCK */
|
||||
|
||||
|
|
@ -869,7 +866,8 @@ try_again:
|
|||
goto try_again;
|
||||
}
|
||||
#ifdef USE_FILE_LOCK
|
||||
} else if (os_file_lock(file, name, F_WRLCK)) {
|
||||
} else if (access_type == OS_FILE_READ_WRITE
|
||||
&& os_file_lock(file, name)) {
|
||||
*success = FALSE;
|
||||
file = -1;
|
||||
#endif
|
||||
|
|
@ -980,7 +978,8 @@ os_file_create_simple_no_error_handling(
|
|||
if (file == -1) {
|
||||
*success = FALSE;
|
||||
#ifdef USE_FILE_LOCK
|
||||
} else if (os_file_lock(file, name, F_WRLCK)) {
|
||||
} else if (access_type == OS_FILE_READ_WRITE
|
||||
&& os_file_lock(file, name)) {
|
||||
*success = FALSE;
|
||||
file = -1;
|
||||
#endif
|
||||
|
|
@ -1194,7 +1193,8 @@ try_again:
|
|||
goto try_again;
|
||||
}
|
||||
#ifdef USE_FILE_LOCK
|
||||
} else if (os_file_lock(file, name, F_WRLCK)) {
|
||||
} else if (create_mode != OS_FILE_OPEN_RAW
|
||||
&& os_file_lock(file, name)) {
|
||||
*success = FALSE;
|
||||
file = -1;
|
||||
#endif
|
||||
|
|
@ -1395,9 +1395,6 @@ os_file_close(
|
|||
#else
|
||||
int ret;
|
||||
|
||||
#ifdef USE_FILE_LOCK
|
||||
(void) os_file_lock(file, "unknown", F_UNLCK);
|
||||
#endif
|
||||
ret = close(file);
|
||||
|
||||
if (ret == -1) {
|
||||
|
|
@ -1434,9 +1431,6 @@ os_file_close_no_error_handling(
|
|||
#else
|
||||
int ret;
|
||||
|
||||
#ifdef USE_FILE_LOCK
|
||||
(void) os_file_lock(file, "unknown", F_UNLCK);
|
||||
#endif
|
||||
ret = close(file);
|
||||
|
||||
if (ret == -1) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ MYSQLSHAREdir = $(pkgdatadir)
|
|||
MYSQLBASEdir= $(prefix)
|
||||
|
||||
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
|
||||
-DNO_EMBEDDED_ACCESS_CHECKS \
|
||||
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
|
||||
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ LIBRARY LIBMYSQLD
|
|||
DESCRIPTION 'MySQL 4.1 Embedded Server Library'
|
||||
VERSION 4.1
|
||||
EXPORTS
|
||||
_dig_vec
|
||||
_dig_vec_upper
|
||||
_dig_vec_lower
|
||||
bmove_upp
|
||||
delete_dynamic
|
||||
free_defaults
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "sp_defs.h"
|
||||
#include "rt_index.h"
|
||||
#include <m_ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(MSDOS) || defined(__WIN__)
|
||||
#ifdef __WIN__
|
||||
|
|
|
|||
4
mysql-test/include/have_geometry.inc
Normal file
4
mysql-test/include/have_geometry.inc
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
-- require r/have_geometry.require
|
||||
disable_query_log;
|
||||
show variables like "have_geometry";
|
||||
enable_query_log;
|
||||
|
|
@ -172,7 +172,7 @@ create table t1 ( URL_ID int(11), URL varchar(80));
|
|||
create table t2 ( REQ_ID int(11), URL_ID int(11));
|
||||
insert into t1 values (4,'www.host.com'), (5,'www.google.com'),(5,'www.help.com');
|
||||
insert into t2 values (1,4), (5,4), (5,5);
|
||||
select REQ_ID, Group_Concat(URL) as URL from t1, t2 where
|
||||
select REQ_ID, Group_Concat(URL) as URL from t1, t2 where
|
||||
t2.URL_ID = t1.URL_ID group by REQ_ID;
|
||||
REQ_ID URL
|
||||
1 X
|
||||
|
|
|
|||
2
mysql-test/r/have_geometry.require
Normal file
2
mysql-test/r/have_geometry.require
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Variable_name Value
|
||||
have_geometry YES
|
||||
|
|
@ -83,7 +83,7 @@ insert into t1 values (4,'www.host.com'), (5,'www.google.com'),(5,'www.help.com'
|
|||
insert into t2 values (1,4), (5,4), (5,5);
|
||||
# Make this order independent
|
||||
--replace_result www.help.com X www.host.com X www.google.com X
|
||||
select REQ_ID, Group_Concat(URL) as URL from t1, t2 where
|
||||
select REQ_ID, Group_Concat(URL) as URL from t1, t2 where
|
||||
t2.URL_ID = t1.URL_ID group by REQ_ID;
|
||||
# check min/max function
|
||||
--replace_result www.help.com X www.host.com X www.google.com X
|
||||
|
|
@ -132,7 +132,7 @@ drop table t1, t2;
|
|||
|
||||
CREATE TABLE t1 (id1 tinyint(4) NOT NULL, id2 tinyint(4) NOT NULL);
|
||||
INSERT INTO t1 VALUES (1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 2),(2, 3);
|
||||
CREATE TABLE t2 (id1 tinyint(4) NOT NULL);
|
||||
CREATE TABLE t2 (id1 tinyint(4) NOT NULL);
|
||||
INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
|
||||
SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 AND t1.id1=1 GROUP BY t1.id1;
|
||||
SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
|
||||
|
|
@ -163,7 +163,7 @@ drop table t1;
|
|||
# Test with subqueries (Bug #3319)
|
||||
#
|
||||
|
||||
create table t1 (a int, c int);
|
||||
create table t1 (a int, c int);
|
||||
insert into t1 values (1, 2), (2, 3), (2, 4), (3, 5);
|
||||
create table t2 (a int, c int);
|
||||
insert into t2 values (1, 5), (2, 4), (3, 3), (3,3);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
-- source include/have_geometry.inc
|
||||
|
||||
#
|
||||
# test of rtree (using with spatial data)
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
-- source include/have_geometry.inc
|
||||
|
||||
#
|
||||
# Spatial objects
|
||||
#
|
||||
|
|
|
|||
|
|
@ -60,13 +60,11 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
|
|||
|
||||
DBUG_PRINT(msg_type,("message: %s",msgbuf));
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if (thd->net.vio == 0)
|
||||
if (!thd->vio_ok())
|
||||
{
|
||||
sql_print_error(msgbuf);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (param->testflag & (T_CREATE_MISSING_KEYS | T_SAFE_REPAIR |
|
||||
T_AUTO_REPAIR))
|
||||
|
|
|
|||
|
|
@ -918,6 +918,7 @@ extern struct my_option my_long_options[];
|
|||
extern SHOW_COMP_OPTION have_isam, have_innodb, have_berkeley_db, have_example_db;
|
||||
extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink;
|
||||
extern SHOW_COMP_OPTION have_query_cache, have_berkeley_db, have_innodb;
|
||||
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
|
||||
extern SHOW_COMP_OPTION have_crypt;
|
||||
extern SHOW_COMP_OPTION have_compress;
|
||||
|
||||
|
|
|
|||
|
|
@ -378,6 +378,7 @@ CHARSET_INFO *national_charset_info, *table_alias_charset;
|
|||
SHOW_COMP_OPTION have_berkeley_db, have_innodb, have_isam,
|
||||
have_ndbcluster, have_example_db;
|
||||
SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_query_cache;
|
||||
SHOW_COMP_OPTION have_geometry, have_rtree_keys;
|
||||
SHOW_COMP_OPTION have_crypt, have_compress;
|
||||
|
||||
/* Thread specific variables */
|
||||
|
|
@ -661,7 +662,7 @@ static void close_connections(void)
|
|||
break;
|
||||
}
|
||||
#ifndef __bsdi__ // Bug in BSDI kernel
|
||||
if (tmp->net.vio)
|
||||
if (tmp->vio_ok())
|
||||
{
|
||||
sql_print_error(ER(ER_FORCING_CLOSE),my_progname,
|
||||
tmp->thread_id,tmp->user ? tmp->user : "");
|
||||
|
|
@ -5362,6 +5363,16 @@ static void mysql_init_variables(void)
|
|||
#else
|
||||
have_query_cache=SHOW_OPTION_NO;
|
||||
#endif
|
||||
#ifdef HAVE_SPATIAL
|
||||
have_geometry=SHOW_OPTION_YES;
|
||||
#else
|
||||
have_geometry=SHOW_OPTION_NO;
|
||||
#endif
|
||||
#ifdef HAVE_RTREE_KEYS
|
||||
have_rtree_keys=SHOW_OPTION_YES;
|
||||
#else
|
||||
have_rtree_keys=SHOW_OPTION_NO;
|
||||
#endif
|
||||
#ifdef HAVE_CRYPT
|
||||
have_crypt=SHOW_OPTION_YES;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -643,10 +643,12 @@ struct show_var_st init_vars[]= {
|
|||
{"have_crypt", (char*) &have_crypt, SHOW_HAVE},
|
||||
{"have_innodb", (char*) &have_innodb, SHOW_HAVE},
|
||||
{"have_isam", (char*) &have_isam, SHOW_HAVE},
|
||||
{"have_geometry", (char*) &have_geometry, SHOW_HAVE},
|
||||
{"have_ndbcluster", (char*) &have_ndbcluster, SHOW_HAVE},
|
||||
{"have_openssl", (char*) &have_openssl, SHOW_HAVE},
|
||||
{"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
|
||||
{"have_raid", (char*) &have_raid, SHOW_HAVE},
|
||||
{"have_rtree_keys", (char*) &have_rtree_keys, SHOW_HAVE},
|
||||
{"have_symlink", (char*) &have_symlink, SHOW_HAVE},
|
||||
{"init_connect", (char*) &sys_init_connect, SHOW_SYS},
|
||||
{"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR},
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ character-set=latin2
|
|||
"Got error %d during FLUSH_LOGS",
|
||||
"Got error %d during CHECKPOINT",
|
||||
"Aborted connection %ld to db: '%-.64s' user: '%-.32s' host: `%-.64s' (%-.64s)",
|
||||
"The handler for the table does not support binary table dump","Binlog closed while trying to FLUSH MASTER",
|
||||
"The handler for the table does not support binary table dump",
|
||||
"Binlog closed while trying to FLUSH MASTER",
|
||||
"Failed rebuilding the index of dumped table '%-.64s'",
|
||||
"Error from master: '%-.64s'",
|
||||
|
|
|
|||
|
|
@ -236,6 +236,18 @@ character-set=cp1250
|
|||
"Mešanje tabela koje podržavaju transakcije i onih koje ne podržavaju transakcije je iskljuèeno",
|
||||
"Opcija '%s' je upotrebljena dva puta u istom iskazu",
|
||||
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
|
||||
"Access denied. You need the %-.128s privilege for this operation",
|
||||
"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL",
|
||||
"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
|
||||
"Variable '%-.64s' doesn't have a default value",
|
||||
"Variable '%-.64s' can't be set to the value of '%-.64s'",
|
||||
"Wrong argument type to variable '%-.64s'",
|
||||
"Variable '%-.64s' can only be set, not read",
|
||||
"Wrong usage/placement of '%s'",
|
||||
"This version of MySQL doesn't yet support '%s'",
|
||||
"Got fatal error %d: '%-.128s' from master when reading data from binary log",
|
||||
"Slave SQL thread ignored the query because of replicate-*-table rules",
|
||||
"Variable '%-.64s' is a %s variable",
|
||||
"Wrong foreign key definition for '%-.64s': %s",
|
||||
"Key reference and table reference doesn't match",
|
||||
"Operand should contain %d column(s)",
|
||||
|
|
|
|||
|
|
@ -1386,7 +1386,7 @@ int fetch_master_table(THD *thd, const char *db_name, const char *table_name,
|
|||
thd->net.no_send_ok = 0; // Clear up garbage after create_table_from_dump
|
||||
if (!called_connected)
|
||||
mysql_close(mysql);
|
||||
if (errmsg && thd->net.vio)
|
||||
if (errmsg && thd->vio_ok())
|
||||
send_error(thd, error, errmsg);
|
||||
DBUG_RETURN(test(error)); // Return 1 on error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -746,7 +746,7 @@ bool select_send::send_data(List<Item> &items)
|
|||
}
|
||||
}
|
||||
thd->sent_row_count++;
|
||||
if (!thd->net.vio)
|
||||
if (!thd->vio_ok())
|
||||
DBUG_RETURN(0);
|
||||
if (!thd->net.report_error)
|
||||
DBUG_RETURN(protocol->write());
|
||||
|
|
|
|||
|
|
@ -932,8 +932,10 @@ public:
|
|||
net.last_errno= 0;
|
||||
net.report_error= 0;
|
||||
}
|
||||
inline bool vio_ok() const { return net.vio; }
|
||||
#else
|
||||
void clear_error();
|
||||
inline bool vio_ok() const { return true; }
|
||||
#endif
|
||||
inline void fatal_error()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1199,7 +1199,8 @@ extern "C" pthread_handler_decl(handle_delayed_insert,arg)
|
|||
/* request for new delayed insert */
|
||||
if (!(thd->lock=mysql_lock_tables(thd,&di->table,1)))
|
||||
{
|
||||
di->dead=thd->killed=1; // Fatal error
|
||||
di->dead= 1; // Some fatal error
|
||||
thd->killed= 1;
|
||||
}
|
||||
pthread_cond_broadcast(&di->cond_client);
|
||||
}
|
||||
|
|
@ -1207,7 +1208,8 @@ extern "C" pthread_handler_decl(handle_delayed_insert,arg)
|
|||
{
|
||||
if (di->handle_inserts())
|
||||
{
|
||||
di->dead=thd->killed=1; // Some fatal error
|
||||
di->dead= 1; // Some fatal error
|
||||
thd->killed= 1;
|
||||
}
|
||||
}
|
||||
di->status=0;
|
||||
|
|
@ -1234,7 +1236,8 @@ end:
|
|||
|
||||
close_thread_tables(thd); // Free the table
|
||||
di->table=0;
|
||||
di->dead=thd->killed=1; // If error
|
||||
di->dead= 1; // If error
|
||||
thd->killed= 1;
|
||||
pthread_cond_broadcast(&di->cond_client); // Safety
|
||||
pthread_mutex_unlock(&di->mutex);
|
||||
|
||||
|
|
|
|||
|
|
@ -1540,13 +1540,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
|
|||
while ((tmp=it++))
|
||||
{
|
||||
struct st_my_thread_var *mysys_var;
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if ((tmp->net.vio || tmp->system_thread) &&
|
||||
if ((tmp->vio_ok() || tmp->system_thread) &&
|
||||
(!user || (tmp->user && !strcmp(tmp->user,user))))
|
||||
#else
|
||||
if (tmp->system_thread &&
|
||||
(!user || (tmp->user && !strcmp(tmp->user,user))))
|
||||
#endif
|
||||
{
|
||||
thread_info *thd_info=new thread_info;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue