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
f16ee298
Commit
f16ee298
authored
Nov 19, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mashka.mysql.fi:/home/my/mysql-4.1
parents
8e1584d7
0bd17351
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
505 additions
and
432 deletions
+505
-432
include/mysql.h
include/mysql.h
+1
-1
libmysql/libmysql.c
libmysql/libmysql.c
+12
-3
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+42
-20
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+6
-13
tests/client_test.c
tests/client_test.c
+444
-395
No files found.
include/mysql.h
View file @
f16ee298
...
...
@@ -604,7 +604,7 @@ MYSQL_RES *STDCALL mysql_param_result(MYSQL_STMT *stmt);
my_ulonglong
STDCALL
mysql_stmt_affected_rows
(
MYSQL_STMT
*
stmt
);
int
STDCALL
mysql_stmt_store_result
(
MYSQL_STMT
*
stmt
);
my_bool
STDCALL
mysql_more_results
(
MYSQL
*
mysql
);
my_bool
STDCALL
mysql_next_result
(
MYSQL
*
mysql
);
int
STDCALL
mysql_next_result
(
MYSQL
*
mysql
);
MYSQL_ROW_OFFSET
STDCALL
mysql_stmt_row_seek
(
MYSQL_STMT
*
stmt
,
MYSQL_ROW_OFFSET
offset
);
MYSQL_ROW_OFFSET
STDCALL
mysql_stmt_row_tell
(
MYSQL_STMT
*
stmt
);
...
...
libmysql/libmysql.c
View file @
f16ee298
...
...
@@ -3317,7 +3317,7 @@ my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt)
my_bool
STDCALL
mysql_stmt_free_result
(
MYSQL_STMT
*
stmt
)
{
MYSQL
*
mysql
;
DBUG_ENTER
(
"mysql_stmt_
close
"
);
DBUG_ENTER
(
"mysql_stmt_
free_result
"
);
DBUG_ASSERT
(
stmt
!=
0
);
...
...
@@ -3498,10 +3498,18 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql)
Reads and returns the next query results
*/
my_bool
STDCALL
mysql_next_result
(
MYSQL
*
mysql
)
int
STDCALL
mysql_next_result
(
MYSQL
*
mysql
)
{
DBUG_ENTER
(
"mysql_next_result"
);
if
(
mysql
->
status
!=
MYSQL_STATUS_READY
)
{
strmov
(
mysql
->
net
.
sqlstate
,
unknown_sqlstate
);
strmov
(
mysql
->
net
.
last_error
,
ER
(
mysql
->
net
.
last_errno
=
CR_COMMANDS_OUT_OF_SYNC
));
DBUG_RETURN
(
1
);
}
mysql
->
net
.
last_error
[
0
]
=
0
;
mysql
->
net
.
last_errno
=
0
;
strmov
(
mysql
->
net
.
sqlstate
,
not_error_sqlstate
);
...
...
@@ -3510,9 +3518,10 @@ my_bool STDCALL mysql_next_result(MYSQL *mysql)
if
(
mysql
->
last_used_con
->
server_status
&
SERVER_MORE_RESULTS_EXISTS
)
DBUG_RETURN
((
*
mysql
->
methods
->
read_query_result
)(
mysql
));
DBUG_RETURN
(
0
);
DBUG_RETURN
(
-
1
);
/* No more results */
}
MYSQL_RES
*
STDCALL
mysql_use_result
(
MYSQL
*
mysql
)
{
return
(
*
mysql
->
methods
->
use_result
)(
mysql
);
...
...
sql/item_cmpfunc.cc
View file @
f16ee298
...
...
@@ -1375,6 +1375,7 @@ cmp_item* cmp_item::get_comparator(Item *item)
return
0
;
// to satisfy compiler :)
}
cmp_item
*
cmp_item_sort_string
::
make_same
()
{
return
new
cmp_item_sort_string_in_static
(
cmp_charset
);
...
...
@@ -1395,6 +1396,23 @@ cmp_item* cmp_item_row::make_same()
return
new
cmp_item_row
();
}
cmp_item_row
::~
cmp_item_row
()
{
DBUG_ENTER
(
"~cmp_item_row"
);
DBUG_PRINT
(
"enter"
,(
"this: %lx"
,
this
));
if
(
comparators
)
{
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
{
if
(
comparators
[
i
])
delete
comparators
[
i
];
}
}
DBUG_VOID_RETURN
;
}
void
cmp_item_row
::
store_value
(
Item
*
item
)
{
THD
*
thd
=
current_thd
;
...
...
@@ -1404,18 +1422,16 @@ void cmp_item_row::store_value(Item *item)
item
->
bring_value
();
item
->
null_value
=
0
;
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
if
((
comparators
[
i
]
=
cmp_item
::
get_comparator
(
item
->
el
(
i
))))
{
comparators
[
i
]
->
store_value
(
item
->
el
(
i
));
item
->
null_value
|=
item
->
el
(
i
)
->
null_value
;
}
else
return
;
{
if
(
!
(
comparators
[
i
]
=
cmp_item
::
get_comparator
(
item
->
el
(
i
))))
break
;
// new failed
comparators
[
i
]
->
store_value
(
item
->
el
(
i
));
item
->
null_value
|=
item
->
el
(
i
)
->
null_value
;
}
}
else
return
;
}
void
cmp_item_row
::
store_value_by_template
(
cmp_item
*
t
,
Item
*
item
)
{
cmp_item_row
*
tmpl
=
(
cmp_item_row
*
)
t
;
...
...
@@ -1430,19 +1446,17 @@ void cmp_item_row::store_value_by_template(cmp_item *t, Item *item)
item
->
bring_value
();
item
->
null_value
=
0
;
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
if
((
comparators
[
i
]
=
tmpl
->
comparators
[
i
]
->
make_same
()))
{
comparators
[
i
]
->
store_value_by_template
(
tmpl
->
comparators
[
i
],
item
->
el
(
i
));
item
->
null_value
|=
item
->
el
(
i
)
->
null_value
;
}
else
return
;
{
if
(
!
(
comparators
[
i
]
=
tmpl
->
comparators
[
i
]
->
make_same
()))
break
;
// new failed
comparators
[
i
]
->
store_value_by_template
(
tmpl
->
comparators
[
i
],
item
->
el
(
i
));
item
->
null_value
|=
item
->
el
(
i
)
->
null_value
;
}
}
else
return
;
}
int
cmp_item_row
::
cmp
(
Item
*
arg
)
{
arg
->
null_value
=
0
;
...
...
@@ -1454,25 +1468,31 @@ int cmp_item_row::cmp(Item *arg)
bool
was_null
=
0
;
arg
->
bring_value
();
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
{
if
(
comparators
[
i
]
->
cmp
(
arg
->
el
(
i
)))
{
if
(
!
arg
->
el
(
i
)
->
null_value
)
return
1
;
was_null
=
1
;
}
}
return
(
arg
->
null_value
=
was_null
);
}
int
cmp_item_row
::
compare
(
cmp_item
*
c
)
{
int
res
;
cmp_item_row
*
cmp
=
(
cmp_item_row
*
)
c
;
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
{
int
res
;
if
((
res
=
comparators
[
i
]
->
compare
(
cmp
->
comparators
[
i
])))
return
res
;
}
return
0
;
}
bool
Item_func_in
::
nulls_in_row
()
{
Item
**
arg
,
**
arg_end
;
...
...
@@ -1484,6 +1504,7 @@ bool Item_func_in::nulls_in_row()
return
0
;
}
static
int
srtcmp_in
(
CHARSET_INFO
*
cs
,
const
String
*
x
,
const
String
*
y
)
{
return
cs
->
coll
->
strnncollsp
(
cs
,
...
...
@@ -1491,6 +1512,7 @@ static int srtcmp_in(CHARSET_INFO *cs, const String *x,const String *y)
(
unsigned
char
*
)
y
->
ptr
(),
y
->
length
());
}
void
Item_func_in
::
fix_length_and_dec
()
{
Item
**
arg
,
**
arg_end
;
...
...
sql/item_cmpfunc.h
View file @
f16ee298
...
...
@@ -638,17 +638,7 @@ class cmp_item_row :public cmp_item
uint
n
;
public:
cmp_item_row
()
:
comparators
(
0
),
n
(
0
)
{}
~
cmp_item_row
()
{
if
(
comparators
)
{
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
{
if
(
comparators
[
i
])
delete
comparators
[
i
];
}
}
}
~
cmp_item_row
();
void
store_value
(
Item
*
item
);
int
cmp
(
Item
*
arg
);
int
compare
(
cmp_item
*
arg
);
...
...
@@ -694,7 +684,7 @@ public:
cmp_item_string
*
cmp
=
(
cmp_item_string
*
)
c
;
return
sortcmp
(
value_res
,
cmp
->
value_res
,
cmp_charset
);
}
cmp_item
*
make_same
()
cmp_item
*
make_same
()
{
return
new
cmp_item_sort_string_in_static
(
cmp_charset
);
}
...
...
@@ -715,7 +705,10 @@ class Item_func_in :public Item_int_func
}
longlong
val_int
();
void
fix_length_and_dec
();
~
Item_func_in
()
{}
~
Item_func_in
()
{
cleanup
();
/* This is not called by Item::~Item() */
}
void
cleanup
()
{
delete
array
;
...
...
tests/client_test.c
View file @
f16ee298
This diff is collapsed.
Click to expand it.
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