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
399bc986
Commit
399bc986
authored
Mar 29, 2007
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge of BUG#26624 and BUG#26625
parents
adc07255
9939b3b7
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
195 additions
and
195 deletions
+195
-195
mysql-test/r/range.result
mysql-test/r/range.result
+28
-0
mysql-test/t/range.test
mysql-test/t/range.test
+32
-0
sql/mysqld.cc.rej
sql/mysqld.cc.rej
+0
-161
sql/opt_range.cc
sql/opt_range.cc
+132
-31
sql/sql_list.h
sql/sql_list.h
+3
-3
No files found.
mysql-test/r/range.result
View file @
399bc986
...
@@ -717,6 +717,34 @@ d8c4177d225791924.30714720
...
@@ -717,6 +717,34 @@ d8c4177d225791924.30714720
d8c4177d2380fc201.39666693
d8c4177d2380fc201.39666693
d8c4177d24ccef970.14957924
d8c4177d24ccef970.14957924
DROP TABLE t1;
DROP TABLE t1;
create table t1 (
c1 char(10), c2 char(10), c3 char(10), c4 char(10),
c5 char(10), c6 char(10), c7 char(10), c8 char(10),
c9 char(10), c10 char(10), c11 char(10), c12 char(10),
c13 char(10), c14 char(10), c15 char(10), c16 char(10),
index(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,c13,c14,c15,c16)
);
insert into t1 (c1) values ('1'),('1'),('1'),('1');
select * from t1 where
c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c11 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c12 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c13 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c14 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c15 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
and c16 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
;
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16
drop table t1;
End of 4.1 tests
End of 4.1 tests
CREATE TABLE t1 (
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
id int(11) NOT NULL auto_increment,
...
...
mysql-test/t/range.test
View file @
399bc986
...
@@ -568,6 +568,38 @@ SELECT s.oxid FROM t1 v, t1 s
...
@@ -568,6 +568,38 @@ SELECT s.oxid FROM t1 v, t1 s
DROP
TABLE
t1
;
DROP
TABLE
t1
;
# BUG#26624 high mem usage (crash) in range optimizer (depends on order of fields in where)
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
),
c3
char
(
10
),
c4
char
(
10
),
c5
char
(
10
),
c6
char
(
10
),
c7
char
(
10
),
c8
char
(
10
),
c9
char
(
10
),
c10
char
(
10
),
c11
char
(
10
),
c12
char
(
10
),
c13
char
(
10
),
c14
char
(
10
),
c15
char
(
10
),
c16
char
(
10
),
index
(
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
,
c9
,
c10
,
c11
,
c12
,
c13
,
c14
,
c15
,
c16
)
);
insert
into
t1
(
c1
)
values
(
'1'
),(
'1'
),(
'1'
),(
'1'
);
# This must run without crash and fast:
select
*
from
t1
where
c1
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c2
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c3
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c4
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c5
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c6
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c7
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c8
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c9
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c10
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c11
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c12
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c13
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c14
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c15
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
and
c16
in
(
"abcdefgh"
,
"123456789"
,
"qwertyuio"
,
"asddfgh"
)
;
drop
table
t1
;
--
echo
End
of
4.1
tests
--
echo
End
of
4.1
tests
#
#
...
...
sql/mysqld.cc.rej
deleted
100644 → 0
View file @
adc07255
***************
*** 177,188 ****
} /* cplusplus */
- #if defined(HAVE_LINUXTHREADS)
- #define THR_KILL_SIGNAL SIGINT
- #else
- #define THR_KILL_SIGNAL SIGUSR2 // Can't use this with LinuxThreads
- #endif
-
#ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
#include <sys/types.h>
#else
--- 177,182 ----
} /* cplusplus */
#ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
#include <sys/types.h>
#else
***************
*** 505,510 ****
static void clean_up_mutexes(void);
static int test_if_case_insensitive(const char *dir_name);
static void create_pid_file();
/****************************************************************************
** Code to end mysqld
--- 499,505 ----
static void clean_up_mutexes(void);
static int test_if_case_insensitive(const char *dir_name);
static void create_pid_file();
+ static uint get_thread_lib(void);
/****************************************************************************
** Code to end mysqld
***************
*** 544,550 ****
DBUG_PRINT("info",("Waiting for select_thread"));
#ifndef DONT_USE_THR_ALARM
! if (pthread_kill(select_thread,THR_CLIENT_ALARM))
break; // allready dead
#endif
set_timespec(abstime, 2);
--- 539,546 ----
DBUG_PRINT("info",("Waiting for select_thread"));
#ifndef DONT_USE_THR_ALARM
! if (pthread_kill(select_thread,
! thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1))
break; // allready dead
#endif
set_timespec(abstime, 2);
***************
*** 844,850 ****
sig,my_thread_id());
}
#ifdef DONT_REMEMBER_SIGNAL
! sigset(sig,print_signal_warning); /* int. thread system calls */
#endif
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
if (sig == SIGALRM)
--- 840,846 ----
sig,my_thread_id());
}
#ifdef DONT_REMEMBER_SIGNAL
! my_sigset(sig, print_signal_warning); /* int. thread system calls */
#endif
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
if (sig == SIGALRM)
***************
*** 1841,1848 ****
DBUG_ENTER("init_signals");
if (test_flags & TEST_SIGINT)
! sigset(THR_KILL_SIGNAL,end_thread_signal);
! sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL))
{
--- 1837,1847 ----
DBUG_ENTER("init_signals");
if (test_flags & TEST_SIGINT)
! {
! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2,
! end_thread_signal);
! }
! my_sigset(THR_SERVER_ALARM, print_signal_warning); // Should never be called!
if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL))
{
***************
*** 1877,1883 ****
#endif
(void) sigemptyset(&set);
#ifdef THREAD_SPECIFIC_SIGPIPE
! sigset(SIGPIPE,abort_thread);
sigaddset(&set,SIGPIPE);
#else
(void) signal(SIGPIPE,SIG_IGN); // Can't know which thread
--- 1876,1882 ----
#endif
(void) sigemptyset(&set);
#ifdef THREAD_SPECIFIC_SIGPIPE
! my_sigset(SIGPIPE, abort_thread);
sigaddset(&set,SIGPIPE);
#else
(void) signal(SIGPIPE,SIG_IGN); // Can't know which thread
***************
*** 2237,2244 ****
MY_INIT(argv[0]); // init my_sys library & pthreads
tzset(); // Set tzname
start_time=time((time_t*) 0);
-
#ifdef OS2
{
// fix timezone for daylight saving
--- 2236,2243 ----
MY_INIT(argv[0]); // init my_sys library & pthreads
tzset(); // Set tzname
+ thd_lib_detected= get_thread_lib();
start_time=time((time_t*) 0);
#ifdef OS2
{
// fix timezone for daylight saving
***************
*** 5547,5552 ****
(void) my_write(file, (byte*) buff, (uint) (end-buff),MYF(MY_WME));
(void) my_close(file, MYF(0));
}
}
--- 5546,5567 ----
(void) my_write(file, (byte*) buff, (uint) (end-buff),MYF(MY_WME));
(void) my_close(file, MYF(0));
}
+ }
+
+
+ static uint get_thread_lib(void)
+ {
+ char buff[64];
+
+ #ifdef _CS_GNU_LIBPTHREAD_VERSION
+ confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff));
+
+ if (!strncasecmp(buff, "NPTL", 4))
+ return THD_LIB_NPTL;
+ else if (!strncasecmp(buff, "linuxthreads", 12))
+ return THD_LIB_LT;
+ #endif
+ return THD_LIB_OTHER;
}
sql/opt_range.cc
View file @
399bc986
This diff is collapsed.
Click to expand it.
sql/sql_list.h
View file @
399bc986
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
class
Sql_alloc
class
Sql_alloc
{
{
public:
public:
static
void
*
operator
new
(
size_t
size
)
static
void
*
operator
new
(
size_t
size
)
throw
()
{
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
}
...
@@ -31,9 +31,9 @@ public:
...
@@ -31,9 +31,9 @@ public:
{
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
}
static
void
*
operator
new
[](
size_t
size
,
MEM_ROOT
*
mem_root
)
static
void
*
operator
new
[](
size_t
size
,
MEM_ROOT
*
mem_root
)
throw
()
{
return
(
void
*
)
alloc_root
(
mem_root
,
(
uint
)
size
);
}
{
return
(
void
*
)
alloc_root
(
mem_root
,
(
uint
)
size
);
}
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
throw
()
{
return
(
void
*
)
alloc_root
(
mem_root
,
(
uint
)
size
);
}
{
return
(
void
*
)
alloc_root
(
mem_root
,
(
uint
)
size
);
}
static
void
operator
delete
(
void
*
ptr
,
size_t
size
)
{
TRASH
(
ptr
,
size
);
}
static
void
operator
delete
(
void
*
ptr
,
size_t
size
)
{
TRASH
(
ptr
,
size
);
}
static
void
operator
delete
(
void
*
ptr
,
MEM_ROOT
*
mem_root
)
static
void
operator
delete
(
void
*
ptr
,
MEM_ROOT
*
mem_root
)
...
...
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