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
4bc6b551
Commit
4bc6b551
authored
Mar 30, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
false/true -> FALSE/TRUE
Fixes after last merge
parent
585d97b7
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
165 additions
and
67 deletions
+165
-67
mysql-test/r/bdb-crash.result
mysql-test/r/bdb-crash.result
+0
-7
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+6
-6
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+105
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+1
-1
sql/field_conv.cc
sql/field_conv.cc
+1
-1
sql/handler.cc
sql/handler.cc
+2
-2
sql/item.cc
sql/item.cc
+1
-1
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+4
-2
sql/item_sum.cc
sql/item_sum.cc
+1
-1
sql/slave.cc
sql/slave.cc
+1
-1
sql/sql_acl.cc
sql/sql_acl.cc
+4
-4
sql/sql_cache.cc
sql/sql_cache.cc
+2
-3
sql/sql_help.cc
sql/sql_help.cc
+3
-3
sql/sql_olap.cc
sql/sql_olap.cc
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+14
-15
sql/sql_table.cc
sql/sql_table.cc
+10
-14
sql/sql_test.cc
sql/sql_test.cc
+8
-4
No files found.
mysql-test/r/bdb-crash.result
View file @
4bc6b551
...
...
@@ -37,10 +37,3 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Operation need committed state
drop table t1;
create table t1 (a int) engine=bdb;
set autocommit=0;
insert into t1 values(1);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Operation need committed state
drop table t1;
mysql-test/r/myisam.result
View file @
4bc6b551
...
...
@@ -474,13 +474,13 @@ select sql_big_result distinct t1.a from t1,t2;
a
1
explain select sql_big_result distinct t1.a from t1,t2 order by t2.a;
table type possible_keys key key_len ref rows Extra
t1 system NULL NULL NULL NULL 1 Using temporary
t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
id select_type
table type possible_keys key key_len ref rows Extra
1 SIMPLE
t1 system NULL NULL NULL NULL 1 Using temporary
1 SIMPLE
t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
explain select distinct t1.a from t1,t2 order by t2.a;
table type possible_keys key key_len ref rows Extra
t1 system NULL NULL NULL NULL 1 Using temporary
t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
id select_type
table type possible_keys key key_len ref rows Extra
1 SIMPLE
t1 system NULL NULL NULL NULL 1 Using temporary
1 SIMPLE
t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
drop table t1,t2;
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX'
...
...
mysql-test/r/order_by.result
View file @
4bc6b551
...
...
@@ -546,3 +546,108 @@ a b
1 2
5 NULL
DROP TABLE t1;
create table t1(id int not null auto_increment primary key, t char(12));
explain select id,t from t1 order by id;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 Using filesort
explain select id,t from t1 force index (primary) order by id;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 1000
drop table t1;
CREATE TABLE t1 (
FieldKey varchar(36) NOT NULL default '',
LongVal bigint(20) default NULL,
StringVal mediumtext,
KEY FieldKey (FieldKey),
KEY LongField (FieldKey,LongVal),
KEY StringField (FieldKey,StringVal(32))
);
INSERT INTO t1 VALUES ('0',3,'0'),('0',2,'1'),('0',1,'2'),('1',2,'1'),('1',1,'3'), ('1',0,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('3',2,'1'),('3',1,'2'),('3','3','3');
EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref FieldKey,LongField,StringField LongField 36 const 3 Using where
SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
FieldKey LongVal StringVal
1 0 2
1 1 3
1 2 1
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range FieldKey,LongField,StringField FieldKey 36 NULL 4 Using where; Using filesort
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
FieldKey LongVal StringVal
3 1 2
3 2 1
3 3 3
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range FieldKey,LongField,StringField LongField 36 NULL 4 Using where
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
FieldKey LongVal StringVal
3 1 2
3 2 1
3 3 3
DROP TABLE t1;
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;
create table t1(a int, b int, index(b));
insert into t1 values (2, 1), (1, 1), (4, NULL), (3, NULL), (6, 2), (5, 2);
explain select * from t1 where b=1 or b is null order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref_or_null b b 5 const 3 Using where; Using filesort
select * from t1 where b=1 or b is null order by a;
a b
1 1
2 1
3 NULL
4 NULL
explain select * from t1 where b=2 or b is null order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref_or_null b b 5 const 4 Using where; Using filesort
select * from t1 where b=2 or b is null order by a;
a b
3 NULL
4 NULL
5 2
6 2
drop table t1;
create table t1 (a int not null auto_increment, b int not null, c int not null, d int not null,
key(a,b,d), key(c,b,a));
create table t2 like t1;
insert into t1 values (NULL, 1, 2, 0), (NULL, 2, 1, 1), (NULL, 3, 4, 2), (NULL, 4, 3, 3);
insert into t2 select null, b, c, d from t1;
insert into t1 select null, b, c, d from t2;
insert into t2 select null, b, c, d from t1;
insert into t1 select null, b, c, d from t2;
insert into t2 select null, b, c, d from t1;
insert into t1 select null, b, c, d from t2;
insert into t2 select null, b, c, d from t1;
insert into t1 select null, b, c, d from t2;
insert into t2 select null, b, c, d from t1;
insert into t1 select null, b, c, d from t2;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
set @row=10;
insert into t1 select 1, b, c + (@row:=@row - 1) * 10, d - @row from t2 limit 10;
select * from t1 where a=1 and b in (1) order by c, b, a;
a b c d
1 1 2 0
1 1 12 -1
1 1 52 -5
1 1 92 -9
select * from t1 where a=1 and b in (1);
a b c d
1 1 92 -9
1 1 52 -5
1 1 12 -1
1 1 2 0
drop table t1, t2;
mysql-test/t/order_by.test
View file @
4bc6b551
...
...
@@ -361,7 +361,7 @@ while ($1)
enable_query_log
;
explain
select
id
,
t
from
t1
order
by
id
;
explain
select
id
,
t
from
t1
force
index
(
primary
)
order
by
id
;
drop
table
t1
;
s
drop
table
t1
;
#
# Test of test_if_subkey() function
...
...
sql/field_conv.cc
View file @
4bc6b551
...
...
@@ -173,7 +173,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
field
->
reset
();
if
(
field
==
field
->
table
->
next_number_field
)
{
field
->
table
->
auto_increment_field_not_null
=
false
;
field
->
table
->
auto_increment_field_not_null
=
FALSE
;
return
0
;
// field is set in handler.cc
}
if
(
current_thd
->
count_cuted_fields
==
CHECK_FIELD_WARN
)
...
...
sql/handler.cc
View file @
4bc6b551
...
...
@@ -879,11 +879,11 @@ void handler::update_auto_increment()
table
->
auto_increment_field_not_null
&&
current_thd
->
variables
.
sql_mode
&
MODE_NO_AUTO_VALUE_ON_ZERO
)
{
table
->
auto_increment_field_not_null
=
false
;
table
->
auto_increment_field_not_null
=
FALSE
;
auto_increment_column_changed
=
0
;
DBUG_VOID_RETURN
;
}
table
->
auto_increment_field_not_null
=
false
;
table
->
auto_increment_field_not_null
=
FALSE
;
thd
=
current_thd
;
if
((
nr
=
thd
->
next_insert_id
))
thd
->
next_insert_id
=
0
;
// Clear after use
...
...
sql/item.cc
View file @
4bc6b551
...
...
@@ -637,7 +637,7 @@ void Item_param::set_time(TIME *tm, timestamp_type type)
ltime
.
time_type
=
type
;
item_is_time
=
true
;
item_is_time
=
TRUE
;
item_type
=
STRING_ITEM
;
value_is_set
=
1
;
}
...
...
sql/item_cmpfunc.cc
View file @
4bc6b551
...
...
@@ -770,11 +770,13 @@ longlong Item_func_between::val_int()
null_value
=
1
;
else
if
(
args
[
1
]
->
null_value
)
{
null_value
=
sortcmp
(
value
,
b
,
cmp_collation
.
collation
)
<=
0
;
// not null if false range.
// Set to not null if false range.
null_value
=
sortcmp
(
value
,
b
,
cmp_collation
.
collation
)
<=
0
;
}
else
{
null_value
=
sortcmp
(
value
,
a
,
cmp_collation
.
collation
)
>=
0
;
// not null if false range.
// Set to not null if false range.
null_value
=
sortcmp
(
value
,
a
,
cmp_collation
.
collation
)
>=
0
;
}
}
else
if
(
cmp_type
==
INT_RESULT
)
...
...
sql/item_sum.cc
View file @
4bc6b551
...
...
@@ -1759,7 +1759,7 @@ void Item_func_group_concat::clear()
result
.
length
(
0
);
result
.
copy
();
null_value
=
TRUE
;
warning_for_row
=
false
;
warning_for_row
=
FALSE
;
if
(
table
)
{
table
->
file
->
extra
(
HA_EXTRA_NO_CACHE
);
...
...
sql/slave.cc
View file @
4bc6b551
...
...
@@ -2681,7 +2681,7 @@ bool st_relay_log_info::is_until_satisfied()
/* Probably error so we aborting */
sql_print_error
(
"Slave SQL thread is stopped because UNTIL "
"condition is bad."
);
return
true
;
return
TRUE
;
}
}
else
...
...
sql/sql_acl.cc
View file @
4bc6b551
...
...
@@ -1293,20 +1293,20 @@ bool hostname_requires_resolving(const char *hostname)
{
char
cur
;
if
(
!
hostname
)
return
false
;
return
FALSE
;
int
namelen
=
strlen
(
hostname
);
int
lhlen
=
strlen
(
my_localhost
);
if
((
namelen
==
lhlen
)
&&
!
my_strnncoll
(
&
my_charset_latin1
,
(
const
uchar
*
)
hostname
,
namelen
,
(
const
uchar
*
)
my_localhost
,
strlen
(
my_localhost
)))
return
false
;
return
FALSE
;
for
(;
(
cur
=*
hostname
);
hostname
++
)
{
if
((
cur
!=
'%'
)
&&
(
cur
!=
'_'
)
&&
(
cur
!=
'.'
)
&&
((
cur
<
'0'
)
||
(
cur
>
'9'
)))
return
true
;
return
TRUE
;
}
return
false
;
return
FALSE
;
}
/*
...
...
sql/sql_cache.cc
View file @
4bc6b551
...
...
@@ -883,9 +883,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
DBUG_PRINT
(
"qcache"
,
(
"Another thread process same query"
));
}
}
else
if
(
thd
->
lex
.
sql_command
==
SQLCOM_SELECT
)
statistic_increment
(
refused
,
&
structure_guard_mutex
);
else
if
(
thd
->
lex
->
sql_command
==
SQLCOM_SELECT
)
statistic_increment
(
refused
,
&
structure_guard_mutex
);
end:
DBUG_VOID_RETURN
;
...
...
sql/sql_help.cc
View file @
4bc6b551
...
...
@@ -731,12 +731,12 @@ int mysqld_help(THD *thd, const char *mask)
&
categories_list
,
&
category_id
);
if
(
!
count_categories
)
{
if
(
send_header_2
(
protocol
,
false
))
if
(
send_header_2
(
protocol
,
FALSE
))
goto
end
;
}
else
if
(
count_categories
>
1
)
{
if
(
send_header_2
(
protocol
,
false
)
||
if
(
send_header_2
(
protocol
,
FALSE
)
||
send_variant_2_list
(
mem_root
,
protocol
,
&
categories_list
,
"Y"
,
0
))
goto
end
;
}
...
...
@@ -780,7 +780,7 @@ int mysqld_help(THD *thd, const char *mask)
else
{
/* First send header and functions */
if
(
send_header_2
(
protocol
,
false
)
||
if
(
send_header_2
(
protocol
,
FALSE
)
||
send_variant_2_list
(
mem_root
,
protocol
,
&
topics_list
,
"N"
,
0
))
goto
end
;
search_categories
(
thd
,
tables
[
1
].
table
,
used_fields
,
...
...
sql/sql_olap.cc
View file @
4bc6b551
...
...
@@ -64,7 +64,7 @@ static int make_new_olap_select(LEX *lex, SELECT_LEX *select_lex, List<Item> new
while
((
item
=
list_it
++
))
{
bool
not_found
=
true
;
bool
not_found
=
TRUE
;
if
(
item
->
type
()
==
Item
::
FIELD_ITEM
)
{
Item_field
*
iif
=
(
Item_field
*
)
item
;
...
...
sql/sql_parse.cc
View file @
4bc6b551
...
...
@@ -1389,7 +1389,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* Clear variables that are allocated */
thd
->
user_connect
=
0
;
int
res
=
check_user
(
thd
,
COM_CHANGE_USER
,
passwd
,
passwd_len
,
db
,
false
);
int
res
=
check_user
(
thd
,
COM_CHANGE_USER
,
passwd
,
passwd_len
,
db
,
FALSE
);
if
(
res
)
{
...
...
sql/sql_select.cc
View file @
4bc6b551
...
...
@@ -1089,7 +1089,7 @@ JOIN::exec()
if
(
!
tables_list
)
{
// Only test of functions
if
(
select_options
&
SELECT_DESCRIBE
)
select_describe
(
this
,
false
,
false
,
false
,
select_describe
(
this
,
FALSE
,
FALSE
,
FALSE
,
(
zero_result_cause
?
zero_result_cause
:
"No tables used"
));
else
{
...
...
@@ -4112,7 +4112,7 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
if
(
select_options
&
SELECT_DESCRIBE
)
{
select_describe
(
join
,
false
,
false
,
false
,
info
);
select_describe
(
join
,
FALSE
,
FALSE
,
FALSE
,
info
);
DBUG_RETURN
(
0
);
}
...
...
@@ -7161,8 +7161,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
/* check if we can use a key to resolve the group */
/* Tables using JT_NEXT are handled here */
uint
nr
;
key_map
keys_to_use
,
keys
;
keys_to_use
.
set_all
();
key_map
keys
;
/*
If not used with LIMIT, only use keys if the whole query can be
...
...
@@ -7170,18 +7169,18 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
retrieving all rows through an index.
*/
if
(
select_limit
>=
table
->
file
->
records
)
{
keys
=
*
table
->
file
->
keys_to_use_for_scanning
();
keys
.
merge
(
table
->
used_keys
);
nning
();
ified
in
FORCE
INDEX
clause
,
n
ORDER
BY
.
ry
);
/*
We are adding here also the index speified in FORCE INDEX clause,
if any.
This is to allow users to use index in ORDER BY.
*/
if
(
table
->
force_index
)
keys
.
merge
(
table
->
keys_in_use_for_query
);
keys
.
intersect
(
usable_keys
);
}
else
keys
=
usable_keys
;
...
...
sql/sql_table.cc
View file @
4bc6b551
...
...
@@ -1669,13 +1669,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
case
HA_ADMIN_REJECT
:
protocol
->
store
(
"status"
,
6
,
system_charset_info
);
protocol
->
store
(
"Operation need committed state"
,
30
,
system_charset_info
);
open_for_modify
=
false
;
break
;
case
HA_ADMIN_REJECT
:
net_store_data
(
packet
,
"status"
);
net_store_data
(
packet
,
"Operation need committed state"
);
open_for_modify
=
false
;
open_for_modify
=
FALSE
;
break
;
case
HA_ADMIN_ALREADY_DONE
:
...
...
@@ -2081,9 +2075,10 @@ int mysql_discard_or_import_tablespace(THD *thd,
err:
close_thread_tables
(
thd
);
thd
->
tablespace_op
=
FALSE
;
if
(
error
==
0
)
{
if
(
error
==
0
)
{
send_ok
(
thd
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
DBUG_RETURN
(
error
);
}
...
...
@@ -2878,13 +2873,14 @@ copy_data_between_tables(TABLE *from,TABLE *to,
goto
err
;
};
/* Turn off recovery logging since rollback of an
alter table is to delete the new table so there
is no need to log the changes to it. */
error
=
ha_recovery_logging
(
thd
,
FALSE
);
/*
Turn off recovery logging since rollback of an alter table is to
delete the new table so there is no need to log the changes to it.
*/
error
=
ha_recovery_logging
(
thd
,
FALSE
);
if
(
error
)
{
error
=
1
;
error
=
1
;
goto
err
;
}
...
...
sql/sql_test.cc
View file @
4bc6b551
...
...
@@ -276,10 +276,14 @@ static void display_table_locks(void)
THR_LOCK
*
lock
=
(
THR_LOCK
*
)
list
->
data
;
VOID
(
pthread_mutex_lock
(
&
lock
->
mutex
));
push_locks_into_array
(
&
saved_table_locks
,
lock
->
write
.
data
,
false
,
"Locked - write"
);
push_locks_into_array
(
&
saved_table_locks
,
lock
->
write_wait
.
data
,
true
,
"Waiting - write"
);
push_locks_into_array
(
&
saved_table_locks
,
lock
->
read
.
data
,
false
,
"Locked - read"
);
push_locks_into_array
(
&
saved_table_locks
,
lock
->
read_wait
.
data
,
true
,
"Waiting - read"
);
push_locks_into_array
(
&
saved_table_locks
,
lock
->
write
.
data
,
FALSE
,
"Locked - write"
);
push_locks_into_array
(
&
saved_table_locks
,
lock
->
write_wait
.
data
,
TRUE
,
"Waiting - write"
);
push_locks_into_array
(
&
saved_table_locks
,
lock
->
read
.
data
,
FALSE
,
"Locked - read"
);
push_locks_into_array
(
&
saved_table_locks
,
lock
->
read_wait
.
data
,
TRUE
,
"Waiting - read"
);
VOID
(
pthread_mutex_unlock
(
&
lock
->
mutex
));
}
VOID
(
pthread_mutex_unlock
(
&
THR_LOCK_lock
));
...
...
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