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
2ffbfe27
Commit
2ffbfe27
authored
Dec 21, 2003
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/my/mysql-4.1 into mysql.com:/my/mysql-5.0
parents
d15f2426
5eb92715
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
59 additions
and
35 deletions
+59
-35
client/mysqltest.c
client/mysqltest.c
+12
-7
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+8
-2
mysql-test/r/init_connect.result
mysql-test/r/init_connect.result
+1
-1
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+6
-0
mysql-test/t/init_connect-master.opt
mysql-test/t/init_connect-master.opt
+1
-1
mysql-test/t/init_connect.test
mysql-test/t/init_connect.test
+1
-1
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+8
-0
sql/filesort.cc
sql/filesort.cc
+1
-13
sql/item.h
sql/item.h
+1
-1
sql/item_func.cc
sql/item_func.cc
+11
-3
sql/log_event.cc
sql/log_event.cc
+2
-2
sql/sql_class.h
sql/sql_class.h
+5
-2
sql/sql_prepare.cc
sql/sql_prepare.cc
+2
-2
No files found.
client/mysqltest.c
View file @
2ffbfe27
...
...
@@ -2154,7 +2154,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
DYNAMIC_STRING
ds_tmp
;
DYNAMIC_STRING
eval_query
;
char
*
query
;
int
query_len
;
int
query_len
,
got_error_on_send
=
0
;
DBUG_ENTER
(
"run_query"
);
if
(
q
->
type
!=
Q_EVAL
)
...
...
@@ -2179,9 +2179,13 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
else
ds
=
&
ds_res
;
if
((
flags
&
QUERY_SEND
)
&&
mysql_send_query
(
mysql
,
query
,
query_len
))
die
(
"At line %u: unable to send query '%s'(mysql_errno=%d,errno=%d)"
,
if
(
flags
&
QUERY_SEND
)
{
got_error_on_send
=
mysql_send_query
(
mysql
,
query
,
query_len
);
if
(
got_error_on_send
&&
!
q
->
expected_errno
[
0
])
die
(
"At line %u: unable to send query '%s' (mysql_errno=%d , errno=%d)"
,
start_lineno
,
query
,
mysql_errno
(
mysql
),
errno
);
}
do
{
...
...
@@ -2194,7 +2198,8 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
if
(
!
(
flags
&
QUERY_REAP
))
DBUG_RETURN
(
0
);
if
((
!
counter
&&
(
*
mysql
->
methods
->
read_query_result
)(
mysql
))
||
if
(
got_error_on_send
||
(
!
counter
&&
(
*
mysql
->
methods
->
read_query_result
)(
mysql
))
||
(
!
(
last_result
=
res
=
mysql_store_result
(
mysql
))
&&
mysql_field_count
(
mysql
)))
{
...
...
mysql-test/mysql-test-run.sh
View file @
2ffbfe27
...
...
@@ -198,6 +198,8 @@ USER_TEST=
EXTRA_MASTER_OPT
=
""
EXTRA_MYSQL_TEST_OPT
=
""
EXTRA_MYSQLDUMP_OPT
=
""
EXTRA_MYSQLBINLOG_OPT
=
""
USE_RUNNING_SERVER
=
""
DO_GCOV
=
""
DO_GDB
=
""
...
...
@@ -373,6 +375,10 @@ while test $# -gt 0; do
--debug=d:t:i:A,
$MYSQL_TEST_DIR
/var/log/slave.trace"
EXTRA_MYSQL_TEST_OPT
=
"
$EXTRA_MYSQL_TEST_OPT
\
--debug=d:t:A,
$MYSQL_TEST_DIR
/var/log/mysqltest.trace"
EXTRA_MYSQLDUMP_OPT
=
"
$EXTRA_MYSQLDUMP_OPT
\
--debug=d:t:A,
$MYSQL_TEST_DIR
/var/log/mysqldump.trace"
EXTRA_MYSQLBINLOG_OPT
=
"
$EXTRA_MYSQLBINLOG_OPT
\
--debug=d:t:A,
$MYSQL_TEST_DIR
/var/log/mysqlbinlog.trace"
;;
--fast
)
FAST_START
=
1
...
...
@@ -490,8 +496,8 @@ else
fi
fi
MYSQL_DUMP
=
"
$MYSQL_DUMP
--no-defaults -uroot --socket=
$MASTER_MYSOCK
"
MYSQL_BINLOG
=
"
$MYSQL_BINLOG
--no-defaults --local-load=
$MYSQL_TMP_DIR
"
MYSQL_DUMP
=
"
$MYSQL_DUMP
--no-defaults -uroot --socket=
$MASTER_MYSOCK
$EXTRA_MYSQLDUMP_OPT
"
MYSQL_BINLOG
=
"
$MYSQL_BINLOG
--no-defaults --local-load=
$MYSQL_TMP_DIR
$EXTRA_MYSQLBINLOG_OPT
"
export
MYSQL_DUMP
export
MYSQL_BINLOG
...
...
mysql-test/r/init_connect.result
View file @
2ffbfe27
...
...
@@ -20,5 +20,5 @@ hex(a)
616263
set GLOBAL init_connect="adsfsdfsdfs";
select @a;
ERROR HY000: Lost connection to MySQL server during query
Got one of the listed errors
drop table t1;
mysql-test/r/order_by.result
View file @
2ffbfe27
...
...
@@ -584,3 +584,9 @@ CREATE TABLE t1 (a INT, b INT);
SET @id=0;
UPDATE t1 SET a=0 ORDER BY (a=@id), b;
DROP TABLE t1;
CREATE TABLE t1 ( id smallint(6) unsigned NOT NULL default '0', menu tinyint(4) NOT NULL default '0', KEY id (id), KEY menu (menu)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (11384, 2),(11392, 2);
SELECT id FROM t1 WHERE id <11984 AND menu =2 ORDER BY id DESC LIMIT 1 ;
id
11392
drop table t1;
mysql-test/t/init_connect-master.opt
View file @
2ffbfe27
--set-variable=init_connect="set @a='a\0c'"
--set-variable=init_connect="set @a='a\
\
0c'"
mysql-test/t/init_connect.test
View file @
2ffbfe27
...
...
@@ -28,7 +28,7 @@ connection con0;
set
GLOBAL
init_connect
=
"adsfsdfsdfs"
;
connect
(
con5
,
localhost
,
user_1
,,);
connection
con5
;
--
error
2013
--
error
2013
,
2006
select
@
a
;
connection
con0
;
drop
table
t1
;
mysql-test/t/order_by.test
View file @
2ffbfe27
...
...
@@ -373,3 +373,11 @@ SET @id=0;
UPDATE
t1
SET
a
=
0
ORDER
BY
(
a
=@
id
),
b
;
DROP
TABLE
t1
;
#
# Bug when doing an order by on a 1 byte string (Bug #2147)
#
CREATE
TABLE
t1
(
id
smallint
(
6
)
unsigned
NOT
NULL
default
'0'
,
menu
tinyint
(
4
)
NOT
NULL
default
'0'
,
KEY
id
(
id
),
KEY
menu
(
menu
))
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
11384
,
2
),(
11392
,
2
);
SELECT
id
FROM
t1
WHERE
id
<
11984
AND
menu
=
2
ORDER
BY
id
DESC
LIMIT
1
;
drop
table
t1
;
sql/filesort.cc
View file @
2ffbfe27
...
...
@@ -161,8 +161,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
records
=
table
->
file
->
estimate_number_of_rows
();
selected_records_file
=
0
;
}
if
(
param
.
rec_length
==
param
.
ref_length
&&
records
>
param
.
max_rows
)
records
=
param
.
max_rows
;
/* purecov: inspected */
if
(
multi_byte_charset
&&
!
(
param
.
tmp_buffer
=
my_malloc
(
param
.
sort_length
,
MYF
(
MY_WME
))))
...
...
@@ -192,7 +190,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
DISK_BUFFER_SIZE
,
MYF
(
MY_WME
)))
goto
err
;
param
.
keys
--
;
param
.
keys
--
;
/* TODO: check why we do this */
param
.
sort_form
=
table
;
param
.
end
=
(
param
.
local_sortorder
=
sortorder
)
+
s_length
;
if
((
records
=
find_all_keys
(
&
param
,
select
,
sort_keys
,
&
buffpek_pointers
,
...
...
@@ -432,16 +430,6 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
if
(
write_keys
(
param
,
sort_keys
,
idx
,
buffpek_pointers
,
tempfile
))
DBUG_RETURN
(
HA_POS_ERROR
);
idx
=
0
;
if
(
param
->
ref_length
==
param
->
rec_length
&&
my_b_tell
(
tempfile
)
/
param
->
rec_length
>=
param
->
max_rows
)
{
/*
We are writing the result index file and have found all
rows that we need. Abort the sort and return the result.
*/
error
=
HA_ERR_END_OF_FILE
;
break
;
/* Found enough records */
}
indexpos
++
;
}
make_sortkey
(
param
,
sort_keys
[
idx
++
],
ref_pos
);
...
...
sql/item.h
View file @
2ffbfe27
...
...
@@ -129,7 +129,7 @@ public:
virtual
~
Item
()
{
name
=
0
;
cleanup
();
}
/*lint -e1509 */
void
set_name
(
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
);
void
init_make_field
(
Send_field
*
tmp_field
,
enum
enum_field_types
type
);
virtual
void
cleanup
()
{}
virtual
void
cleanup
()
{
fixed
=
0
;
}
virtual
void
make_field
(
Send_field
*
field
);
virtual
bool
fix_fields
(
THD
*
,
struct
st_table_list
*
,
Item
**
);
virtual
int
save_in_field
(
Field
*
field
,
bool
no_conversions
);
...
...
sql/item_func.cc
View file @
2ffbfe27
...
...
@@ -1782,17 +1782,25 @@ char *ull_get_key(const ULL *ull,uint *length,
return
(
char
*
)
ull
->
key
;
}
static
bool
item_user_lock_inited
=
0
;
void
item_user_lock_init
(
void
)
{
pthread_mutex_init
(
&
LOCK_user_locks
,
MY_MUTEX_INIT_SLOW
);
hash_init
(
&
hash_user_locks
,
system_charset_info
,
16
,
0
,
0
,(
hash_get_key
)
ull_get_key
,
NULL
,
0
);
item_user_lock_inited
=
1
;
}
void
item_user_lock_free
(
void
)
{
if
(
item_user_lock_inited
)
{
item_user_lock_inited
=
0
;
hash_free
(
&
hash_user_locks
);
pthread_mutex_destroy
(
&
LOCK_user_locks
);
}
}
void
item_user_lock_release
(
ULL
*
ull
)
...
...
@@ -2452,7 +2460,7 @@ Item_func_get_user_var::val_str(String *str)
{
DBUG_ENTER
(
"Item_func_get_user_var::val_str"
);
if
(
!
var_entry
)
return
(
String
*
)
0
;
// No such variable
DBUG_RETURN
((
String
*
)
0
);
// No such variable
DBUG_RETURN
(
var_entry
->
val_str
(
&
null_value
,
str
,
decimals
));
}
...
...
sql/log_event.cc
View file @
2ffbfe27
...
...
@@ -3080,13 +3080,13 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
float8get
(
real_val
,
val
);
it
=
new
Item_real
(
real_val
);
val
=
(
char
*
)
&
real_val
;
// Pointer to value in native format
val_len
=
sizeof
(
real_val
)
;
val_len
=
8
;
break
;
case
INT_RESULT
:
int_val
=
(
longlong
)
uint8korr
(
val
);
it
=
new
Item_int
(
int_val
);
val
=
(
char
*
)
&
int_val
;
// Pointer to value in native format
val_len
=
sizeof
(
int_val
)
;
val_len
=
8
;
break
;
case
STRING_RESULT
:
it
=
new
Item_string
(
val
,
val_len
,
charset
);
...
...
sql/sql_class.h
View file @
2ffbfe27
...
...
@@ -847,8 +847,11 @@ public:
inline
void
end_time
()
{
time
(
&
start_time
);
}
inline
void
set_time
(
time_t
t
)
{
time_after_lock
=
start_time
=
user_time
=
t
;
}
inline
void
lock_time
()
{
time
(
&
time_after_lock
);
}
inline
void
insert_id
(
ulonglong
id
)
{
last_insert_id
=
id
;
insert_id_used
=
1
;
}
inline
void
insert_id
(
ulonglong
id_arg
)
{
last_insert_id
=
id_arg
;
insert_id_used
=
1
;
}
inline
ulonglong
insert_id
(
void
)
{
if
(
!
last_insert_id_used
)
...
...
sql/sql_prepare.cc
View file @
2ffbfe27
...
...
@@ -888,7 +888,7 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
{
LEX
*
lex
;
Prepared_statement
*
stmt
=
new
Prepared_statement
(
thd
);
SELECT_LEX
*
sl
;
DBUG_ENTER
(
"mysql_stmt_prepare"
);
if
(
stmt
==
0
)
...
...
@@ -919,7 +919,7 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
my_pthread_setprio
(
pthread_self
(),
WAIT_PRIOR
);
// save WHERE clause pointers to avoid damaging they by optimisation
for
(
SELECT_LEX
*
sl
=
thd
->
lex
->
all_selects_list
;
for
(
sl
=
thd
->
lex
->
all_selects_list
;
sl
;
sl
=
sl
->
next_select_in_list
())
{
...
...
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