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
a19b0f0a
Commit
a19b0f0a
authored
Jun 19, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup for Item_func_regex (Bug #4199)
parent
7997372a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
2 deletions
+36
-2
mysql-test/r/func_regexp.result
mysql-test/r/func_regexp.result
+17
-0
mysql-test/t/func_regexp.test
mysql-test/t/func_regexp.test
+13
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+5
-1
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+1
-1
No files found.
mysql-test/r/func_regexp.result
View file @
a19b0f0a
...
...
@@ -81,3 +81,20 @@ _latin1'a' regexp _latin1'A' collate latin1_general_ci
select _latin1'a' regexp _latin1'A' collate latin1_bin;
_latin1'a' regexp _latin1'A' collate latin1_bin
0
create table t1 (a varchar(40));
insert into t1 values ('C1'),('C2'),('R1'),('C3'),('R2'),('R3');
prepare stmt1 from 'select a from t1 where a rlike ? order by a';
set @a="^C.*";
execute stmt1 using @a;
a
C1
C2
C3
set @a="^R.*";
execute stmt1 using @a;
a
R1
R2
R3
deallocate prepare stmt1;
drop table t1;
mysql-test/t/func_regexp.test
View file @
a19b0f0a
...
...
@@ -60,3 +60,16 @@ select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]';
select
_latin1
'a'
regexp
_latin1
'A'
collate
latin1_general_ci
;
select
_latin1
'a'
regexp
_latin1
'A'
collate
latin1_bin
;
#
# regexp cleanup()
#
create
table
t1
(
a
varchar
(
40
));
insert
into
t1
values
(
'C1'
),(
'C2'
),(
'R1'
),(
'C3'
),(
'R2'
),(
'R3'
);
prepare
stmt1
from
'select a from t1 where a rlike ? order by a'
;
set
@
a
=
"^C.*"
;
execute
stmt1
using
@
a
;
set
@
a
=
"^R.*"
;
execute
stmt1
using
@
a
;
deallocate
prepare
stmt1
;
drop
table
t1
;
sql/item_cmpfunc.cc
View file @
a19b0f0a
...
...
@@ -2298,15 +2298,19 @@ longlong Item_func_regex::val_int()
}
Item_func_regex
::~
Item_func_regex
()
void
Item_func_regex
::
cleanup
()
{
DBUG_ENTER
(
"Item_func_regex::cleanup"
);
Item_bool_func
::
cleanup
();
if
(
regex_compiled
)
{
regfree
(
&
preg
);
regex_compiled
=
0
;
}
DBUG_VOID_RETURN
;
}
#endif
/* USE_REGEX */
...
...
sql/item_cmpfunc.h
View file @
a19b0f0a
...
...
@@ -869,7 +869,7 @@ class Item_func_regex :public Item_bool_func
public:
Item_func_regex
(
Item
*
a
,
Item
*
b
)
:
Item_bool_func
(
a
,
b
),
regex_compiled
(
0
),
regex_is_const
(
0
)
{}
~
Item_func_regex
();
void
cleanup
();
longlong
val_int
();
bool
fix_fields
(
THD
*
thd
,
struct
st_table_list
*
tlist
,
Item
**
ref
);
const
char
*
func_name
()
const
{
return
"regexp"
;
}
...
...
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