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
a166d8ca
Commit
a166d8ca
authored
Aug 18, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge
parents
619b4b0f
88a7d01e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
32 deletions
+61
-32
include/my_global.h
include/my_global.h
+17
-1
mysql-test/r/select.result
mysql-test/r/select.result
+0
-11
mysql-test/r/view.result
mysql-test/r/view.result
+12
-0
mysql-test/t/select.test
mysql-test/t/select.test
+0
-11
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+0
-6
sql/item_func.cc
sql/item_func.cc
+28
-2
sql/sql_lex.cc
sql/sql_lex.cc
+4
-1
No files found.
include/my_global.h
View file @
a166d8ca
...
...
@@ -927,7 +927,17 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#ifndef set_timespec
#ifdef HAVE_TIMESPEC_TS_SEC
#define set_timespec(ABSTIME,SEC) { (ABSTIME).ts_sec=time(0) + (time_t) (SEC); (ABSTIME).ts_nsec=0; }
#define set_timespec(ABSTIME,SEC) \
{ \
(ABSTIME).ts_sec=time(0) + (time_t) (SEC); \
(ABSTIME).ts_nsec=0; \
}
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
ulonglong now= my_getsystime(); \
(ABSTIME).ts_sec= (now / ULL(10000000)) + (NSEC / ULL(1000000000)); \
(ABSTIME).ts_nsec= (now % ULL(10000000)) * 100 + (NSEC % ULL(1000000000)); \
}
#else
#define set_timespec(ABSTIME,SEC) \
{\
...
...
@@ -936,6 +946,12 @@ typedef char bool; /* Ordinary boolean values 0 1 */
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
ulonglong now= my_getsystime(); \
(ABSTIME).tv_sec= (now / ULL(10000000)) + (NSEC / ULL(1000000000)); \
(ABSTIME).tv_nsec= (now % ULL(10000000)) * 100 + (NSEC % ULL(1000000000)); \
}
#endif
/* HAVE_TIMESPEC_TS_SEC */
#endif
/* set_timespec */
...
...
mysql-test/r/select.result
View file @
a166d8ca
...
...
@@ -2756,14 +2756,3 @@ DROP TABLE t1,t2;
select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0
16 16 2 2
CREATE TABLE BUG_12595(a varchar(100));
INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an");
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
a
hakan%
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
ERROR HY000: Incorrect arguments to ESCAPE
SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%';
a
ha%an
DROP TABLE BUG_12595;
mysql-test/r/view.result
View file @
a166d8ca
...
...
@@ -2097,6 +2097,18 @@ select * from v1;
f1
1
drop view v1;
create table t1 (f1 int);
create table t2 (f1 int);
insert into t1 values (1);
insert into t2 values (2);
create view v1 as select * from t1 union select * from t2 union all select * from t2;
select * from v1;
f1
1
2
2
drop view v1;
drop table t1,t2;
CREATE TEMPORARY TABLE t1 (a int);
CREATE FUNCTION f1 () RETURNS int RETURN (SELECT COUNT(*) FROM t1);
CREATE VIEW v1 AS SELECT f1();
...
...
mysql-test/t/select.test
View file @
a166d8ca
...
...
@@ -2348,14 +2348,3 @@ DROP TABLE t1,t2;
#
select
x
'10'
+
0
,
X
'10'
+
0
,
b
'10'
+
0
,
B
'10'
+
0
;
#
# BUG #12595
#
CREATE
TABLE
BUG_12595
(
a
varchar
(
100
));
INSERT
INTO
BUG_12595
VALUES
(
'hakan%'
),
(
'hakank'
),
(
"ha%an"
);
SELECT
*
FROM
BUG_12595
WHERE
a
LIKE
'hakan*%'
ESCAPE
'*'
;
--
error
1210
SELECT
*
FROM
BUG_12595
WHERE
a
LIKE
'hakan**%'
ESCAPE
'**'
;
SELECT
*
FROM
BUG_12595
WHERE
a
LIKE
'ha%%an'
ESCAPE
'%'
;
DROP
TABLE
BUG_12595
;
sql/item_cmpfunc.cc
View file @
a166d8ca
...
...
@@ -2792,12 +2792,6 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
{
/* If we are on execution stage */
String
*
escape_str
=
escape_item
->
val_str
(
&
tmp_value1
);
/* ESCAPE must be 1 char in length.*/
if
(
escape_str
&&
escape_str
->
numchars
()
!=
1
)
{
my_error
(
ER_WRONG_ARGUMENTS
,
MYF
(
0
),
"ESCAPE"
);
return
TRUE
;
}
escape
=
escape_str
?
*
(
escape_str
->
ptr
())
:
'\\'
;
/*
...
...
sql/item_func.cc
View file @
a166d8ca
...
...
@@ -3266,10 +3266,36 @@ void Item_func_benchmark::print(String *str)
longlong
Item_func_sleep
::
val_int
()
{
THD
*
thd
=
current_thd
;
struct
timespec
abstime
;
pthread_cond_t
cond
;
int
error
;
DBUG_ASSERT
(
fixed
==
1
);
double
time
=
args
[
0
]
->
val_real
();
my_sleep
((
ulong
)
time
*
1000000L
);
return
0
;
set_timespec_nsec
(
abstime
,
(
ulonglong
)(
time
*
ULL
(
1000000000
)));
pthread_cond_init
(
&
cond
,
NULL
);
pthread_mutex_lock
(
&
LOCK_user_locks
);
thd
->
mysys_var
->
current_mutex
=
&
LOCK_user_locks
;
thd
->
mysys_var
->
current_cond
=
&
cond
;
while
(
!
thd
->
killed
&&
(
error
=
pthread_cond_timedwait
(
&
cond
,
&
LOCK_user_locks
,
&
abstime
))
!=
ETIMEDOUT
&&
error
!=
EINVAL
)
;
pthread_mutex_lock
(
&
thd
->
mysys_var
->
mutex
);
thd
->
mysys_var
->
current_mutex
=
0
;
thd
->
mysys_var
->
current_cond
=
0
;
pthread_mutex_unlock
(
&
thd
->
mysys_var
->
mutex
);
pthread_mutex_unlock
(
&
LOCK_user_locks
);
pthread_cond_destroy
(
&
cond
);
return
(
error
==
ETIMEDOUT
)
?
0
:
1
;
}
...
...
sql/sql_lex.cc
View file @
a166d8ca
...
...
@@ -1511,13 +1511,16 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
void
st_select_lex_unit
::
print
(
String
*
str
)
{
bool
union_all
=
!
union_distinct
;
for
(
SELECT_LEX
*
sl
=
first_select
();
sl
;
sl
=
sl
->
next_select
())
{
if
(
sl
!=
first_select
())
{
str
->
append
(
" union "
,
7
);
if
(
!
union_distinct
)
if
(
union_all
)
str
->
append
(
"all "
,
4
);
else
if
(
union_distinct
==
sl
)
union_all
=
true
;
}
if
(
sl
->
braces
)
str
->
append
(
'('
);
...
...
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