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
c6d8121c
Commit
c6d8121c
authored
Sep 12, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@build.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/local/home/marty/MySQL/test/mysql-4.1
parents
180abf83
4e639af7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
7 deletions
+16
-7
libmysql/libmysql.c
libmysql/libmysql.c
+5
-5
mysql-test/r/func_set.result
mysql-test/r/func_set.result
+3
-0
mysql-test/t/func_set.test
mysql-test/t/func_set.test
+5
-0
sql/item_func.cc
sql/item_func.cc
+3
-2
No files found.
libmysql/libmysql.c
View file @
c6d8121c
...
@@ -1860,14 +1860,14 @@ MYSQL_STMT * STDCALL mysql_prepare(MYSQL *mysql, const char *query,
...
@@ -1860,14 +1860,14 @@ MYSQL_STMT * STDCALL mysql_prepare(MYSQL *mysql, const char *query,
a server-side prepared statement. Memory for this structure (~700
a server-side prepared statement. Memory for this structure (~700
bytes) is allocated using 'malloc'. Once created, the handle can be
bytes) is allocated using 'malloc'. Once created, the handle can be
reused many times. Created statement handle is bound to connection
reused many times. Created statement handle is bound to connection
handle provided to this call: it
'
s lifetime is limited by lifetime
handle provided to this call: its lifetime is limited by lifetime
of connection.
of connection.
'mysql_stmt_init()' is a pure local call, server side structure is
'mysql_stmt_init()' is a pure local call, server side structure is
created only in mysql_stmt_prepare.
created only in mysql_stmt_prepare.
Next steps you may want to make:
Next steps you may want to make:
- set a statement attribute (mysql_stmt_attr_set()),
- set a statement attribute (mysql_stmt_attr_set()),
- prepare statement handle with a query (mysql_stmt_prepare()),
- prepare statement handle with a query (mysql_stmt_prepare()),
- close statement handle and free it
'
s memory (mysql_stmt_close()),
- close statement handle and free its memory (mysql_stmt_close()),
- reset statement with mysql_stmt_reset() (a no-op which will
- reset statement with mysql_stmt_reset() (a no-op which will
just return).
just return).
Behaviour of the rest of API calls on this statement is not defined yet
Behaviour of the rest of API calls on this statement is not defined yet
...
@@ -2592,7 +2592,7 @@ stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)),
...
@@ -2592,7 +2592,7 @@ stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)),
mysql_stmt_attr_get()
mysql_stmt_attr_get()
mysql_stmt_attr_set()
mysql_stmt_attr_set()
attr_type statemen
e
t attribute
attr_type statement attribute
value casted to const void * pointer to value.
value casted to const void * pointer to value.
RETURN VALUE
RETURN VALUE
...
@@ -2688,7 +2688,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
...
@@ -2688,7 +2688,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
mysql_stmt_free_result
(
stmt
);
mysql_stmt_free_result
(
stmt
);
/*
/*
No need to check for stmt->state: if the statement wasn't
No need to check for stmt->state: if the statement wasn't
prepared we'll get 'unknown statemen
e
t handler' error from server.
prepared we'll get 'unknown statement handler' error from server.
*/
*/
if
(
mysql
->
methods
->
stmt_execute
(
stmt
))
if
(
mysql
->
methods
->
stmt_execute
(
stmt
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
...
@@ -2813,7 +2813,7 @@ static my_bool int_is_null_false= 0;
...
@@ -2813,7 +2813,7 @@ static my_bool int_is_null_false= 0;
By properly initializing bind array you can bind virtually any
By properly initializing bind array you can bind virtually any
C language type to statement's placeholders:
C language type to statement's placeholders:
First, it's strongly recommended to always zero-initialize entire
First, it's strongly recommended to always zero-initialize entire
bind structure before setting it
'
s members. This will both shorten
bind structure before setting its members. This will both shorten
your application code and make it robust to future extensions of
your application code and make it robust to future extensions of
MYSQL_BIND structure.
MYSQL_BIND structure.
Then you need to assign typecode of your application buffer to
Then you need to assign typecode of your application buffer to
...
...
mysql-test/r/func_set.result
View file @
c6d8121c
...
@@ -64,3 +64,6 @@ find_in_set('a',binary 'A,B,C')
...
@@ -64,3 +64,6 @@ find_in_set('a',binary 'A,B,C')
select find_in_set(binary 'a', 'A,B,C');
select find_in_set(binary 'a', 'A,B,C');
find_in_set(binary 'a', 'A,B,C')
find_in_set(binary 'a', 'A,B,C')
0
0
select find_in_set('1','3,1,');
find_in_set('1','3,1,')
2
mysql-test/t/func_set.test
View file @
c6d8121c
...
@@ -47,3 +47,8 @@ select find_in_set(binary 'a',binary 'A,B,C');
...
@@ -47,3 +47,8 @@ select find_in_set(binary 'a',binary 'A,B,C');
select
find_in_set
(
'a'
,
binary
'A,B,C'
);
select
find_in_set
(
'a'
,
binary
'A,B,C'
);
select
find_in_set
(
binary
'a'
,
'A,B,C'
);
select
find_in_set
(
binary
'a'
,
'A,B,C'
);
#
# Bug5513:FIND_IN_SET fails if set ends with a comma
#
select
find_in_set
(
'1'
,
'3,1,'
);
sql/item_func.cc
View file @
c6d8121c
...
@@ -1455,10 +1455,11 @@ longlong Item_func_find_in_set::val_int()
...
@@ -1455,10 +1455,11 @@ longlong Item_func_find_in_set::val_int()
{
{
const
char
*
substr_end
=
str_end
+
symbol_len
;
const
char
*
substr_end
=
str_end
+
symbol_len
;
bool
is_last_item
=
(
substr_end
==
real_end
);
bool
is_last_item
=
(
substr_end
==
real_end
);
if
(
wc
==
(
my_wc_t
)
separator
||
is_last_item
)
bool
is_separator
=
(
wc
==
(
my_wc_t
)
separator
);
if
(
is_separator
||
is_last_item
)
{
{
position
++
;
position
++
;
if
(
is_last_item
)
if
(
is_last_item
&&
!
is_separator
)
str_end
=
substr_end
;
str_end
=
substr_end
;
if
(
!
my_strnncoll
(
cs
,
(
const
uchar
*
)
str_begin
,
if
(
!
my_strnncoll
(
cs
,
(
const
uchar
*
)
str_begin
,
str_end
-
str_begin
,
str_end
-
str_begin
,
...
...
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