Commit ceeaa24d authored by unknown's avatar unknown

false/true -> FALSE/TRUE

Fixes after last merge


mysql-test/r/bdb-crash.result:
  fixed bad merge
mysql-test/r/myisam.result:
  after merge fix
mysql-test/r/order_by.result:
  fixed bad merge
mysql-test/t/order_by.test:
  after merge fix
sql/field_conv.cc:
  false/true -> FALSE/TRUE
sql/handler.cc:
  false/true -> FALSE/TRUE
sql/item.cc:
  false/true -> FALSE/TRUE
sql/item_cmpfunc.cc:
  false/true -> FALSE/TRUE
sql/item_sum.cc:
  false/true -> FALSE/TRUE
sql/slave.cc:
  false/true -> FALSE/TRUE
sql/sql_acl.cc:
  false/true -> FALSE/TRUE
sql/sql_cache.cc:
  after merge fix
sql/sql_help.cc:
  false/true -> FALSE/TRUE
sql/sql_olap.cc:
  false/true -> FALSE/TRUE
sql/sql_parse.cc:
  false/true -> FALSE/TRUE
sql/sql_select.cc:
  fix after bad merge
sql/sql_table.cc:
  fix after bad merge
sql/sql_test.cc:
  false/true -> FALSE/TRUE
parent db9fde08
...@@ -37,10 +37,3 @@ analyze table t1; ...@@ -37,10 +37,3 @@ analyze table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 analyze status Operation need committed state test.t1 analyze status Operation need committed state
drop table t1; 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;
...@@ -474,13 +474,13 @@ select sql_big_result distinct t1.a from t1,t2; ...@@ -474,13 +474,13 @@ select sql_big_result distinct t1.a from t1,t2;
a a
1 1
explain select sql_big_result distinct t1.a from t1,t2 order by t2.a; 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 id select_type table type possible_keys key key_len ref rows Extra
t1 system NULL NULL NULL NULL 1 Using temporary 1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary
t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct 1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
explain select distinct t1.a from t1,t2 order by t2.a; explain select distinct t1.a from t1,t2 order by t2.a;
table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
t1 system NULL NULL NULL NULL 1 Using temporary 1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary
t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct 1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
drop table t1,t2; 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; 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' ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX'
......
...@@ -546,3 +546,108 @@ a b ...@@ -546,3 +546,108 @@ a b
1 2 1 2
5 NULL 5 NULL
DROP TABLE t1; 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;
...@@ -361,7 +361,7 @@ while ($1) ...@@ -361,7 +361,7 @@ while ($1)
enable_query_log; enable_query_log;
explain select id,t from t1 order by id; explain select id,t from t1 order by id;
explain select id,t from t1 force index (primary) 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 # Test of test_if_subkey() function
......
...@@ -173,7 +173,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions) ...@@ -173,7 +173,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
field->reset(); field->reset();
if (field == field->table->next_number_field) 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 return 0; // field is set in handler.cc
} }
if (current_thd->count_cuted_fields == CHECK_FIELD_WARN) if (current_thd->count_cuted_fields == CHECK_FIELD_WARN)
......
...@@ -879,11 +879,11 @@ void handler::update_auto_increment() ...@@ -879,11 +879,11 @@ void handler::update_auto_increment()
table->auto_increment_field_not_null && table->auto_increment_field_not_null &&
current_thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO) 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; auto_increment_column_changed=0;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
table->auto_increment_field_not_null= false; table->auto_increment_field_not_null= FALSE;
thd=current_thd; thd=current_thd;
if ((nr=thd->next_insert_id)) if ((nr=thd->next_insert_id))
thd->next_insert_id=0; // Clear after use thd->next_insert_id=0; // Clear after use
......
...@@ -637,7 +637,7 @@ void Item_param::set_time(TIME *tm, timestamp_type type) ...@@ -637,7 +637,7 @@ void Item_param::set_time(TIME *tm, timestamp_type type)
ltime.time_type= type; ltime.time_type= type;
item_is_time= true; item_is_time= TRUE;
item_type= STRING_ITEM; item_type= STRING_ITEM;
value_is_set= 1; value_is_set= 1;
} }
......
...@@ -770,11 +770,13 @@ longlong Item_func_between::val_int() ...@@ -770,11 +770,13 @@ longlong Item_func_between::val_int()
null_value=1; null_value=1;
else if (args[1]->null_value) 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 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) else if (cmp_type == INT_RESULT)
......
...@@ -1759,7 +1759,7 @@ void Item_func_group_concat::clear() ...@@ -1759,7 +1759,7 @@ void Item_func_group_concat::clear()
result.length(0); result.length(0);
result.copy(); result.copy();
null_value= TRUE; null_value= TRUE;
warning_for_row= false; warning_for_row= FALSE;
if (table) if (table)
{ {
table->file->extra(HA_EXTRA_NO_CACHE); table->file->extra(HA_EXTRA_NO_CACHE);
......
...@@ -2681,7 +2681,7 @@ bool st_relay_log_info::is_until_satisfied() ...@@ -2681,7 +2681,7 @@ bool st_relay_log_info::is_until_satisfied()
/* Probably error so we aborting */ /* Probably error so we aborting */
sql_print_error("Slave SQL thread is stopped because UNTIL " sql_print_error("Slave SQL thread is stopped because UNTIL "
"condition is bad."); "condition is bad.");
return true; return TRUE;
} }
} }
else else
......
...@@ -1293,20 +1293,20 @@ bool hostname_requires_resolving(const char *hostname) ...@@ -1293,20 +1293,20 @@ bool hostname_requires_resolving(const char *hostname)
{ {
char cur; char cur;
if (!hostname) if (!hostname)
return false; return FALSE;
int namelen= strlen(hostname); int namelen= strlen(hostname);
int lhlen= strlen(my_localhost); int lhlen= strlen(my_localhost);
if ((namelen == lhlen) && if ((namelen == lhlen) &&
!my_strnncoll(&my_charset_latin1, (const uchar *)hostname, namelen, !my_strnncoll(&my_charset_latin1, (const uchar *)hostname, namelen,
(const uchar *)my_localhost, strlen(my_localhost))) (const uchar *)my_localhost, strlen(my_localhost)))
return false; return FALSE;
for (; (cur=*hostname); hostname++) for (; (cur=*hostname); hostname++)
{ {
if ((cur != '%') && (cur != '_') && (cur != '.') && if ((cur != '%') && (cur != '_') && (cur != '.') &&
((cur < '0') || (cur > '9'))) ((cur < '0') || (cur > '9')))
return true; return TRUE;
} }
return false; return FALSE;
} }
/* /*
......
...@@ -883,8 +883,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) ...@@ -883,8 +883,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
DBUG_PRINT("qcache", ("Another thread process same query")); DBUG_PRINT("qcache", ("Another thread process same query"));
} }
} }
else else if (thd->lex->sql_command == SQLCOM_SELECT)
if (thd->lex.sql_command == SQLCOM_SELECT)
statistic_increment(refused, &structure_guard_mutex); statistic_increment(refused, &structure_guard_mutex);
end: end:
......
...@@ -731,12 +731,12 @@ int mysqld_help(THD *thd, const char *mask) ...@@ -731,12 +731,12 @@ int mysqld_help(THD *thd, const char *mask)
&categories_list,&category_id); &categories_list,&category_id);
if (!count_categories) if (!count_categories)
{ {
if (send_header_2(protocol,false)) if (send_header_2(protocol,FALSE))
goto end; goto end;
} }
else if (count_categories > 1) 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)) send_variant_2_list(mem_root,protocol,&categories_list,"Y",0))
goto end; goto end;
} }
...@@ -780,7 +780,7 @@ int mysqld_help(THD *thd, const char *mask) ...@@ -780,7 +780,7 @@ int mysqld_help(THD *thd, const char *mask)
else else
{ {
/* First send header and functions */ /* 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)) send_variant_2_list(mem_root,protocol, &topics_list, "N", 0))
goto end; goto end;
search_categories(thd, tables[1].table, used_fields, search_categories(thd, tables[1].table, used_fields,
......
...@@ -64,7 +64,7 @@ static int make_new_olap_select(LEX *lex, SELECT_LEX *select_lex, List<Item> new ...@@ -64,7 +64,7 @@ static int make_new_olap_select(LEX *lex, SELECT_LEX *select_lex, List<Item> new
while ((item=list_it++)) while ((item=list_it++))
{ {
bool not_found=true; bool not_found= TRUE;
if (item->type()==Item::FIELD_ITEM) if (item->type()==Item::FIELD_ITEM)
{ {
Item_field *iif = (Item_field *)item; Item_field *iif = (Item_field *)item;
......
...@@ -1389,7 +1389,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1389,7 +1389,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* Clear variables that are allocated */ /* Clear variables that are allocated */
thd->user_connect= 0; 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) if (res)
{ {
......
...@@ -1089,7 +1089,7 @@ JOIN::exec() ...@@ -1089,7 +1089,7 @@ JOIN::exec()
if (!tables_list) if (!tables_list)
{ // Only test of functions { // Only test of functions
if (select_options & SELECT_DESCRIBE) 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")); (zero_result_cause?zero_result_cause:"No tables used"));
else else
{ {
...@@ -4112,7 +4112,7 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables, ...@@ -4112,7 +4112,7 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
if (select_options & SELECT_DESCRIBE) if (select_options & SELECT_DESCRIBE)
{ {
select_describe(join, false, false, false, info); select_describe(join, FALSE, FALSE, FALSE, info);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -7161,8 +7161,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, ...@@ -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 */ /* check if we can use a key to resolve the group */
/* Tables using JT_NEXT are handled here */ /* Tables using JT_NEXT are handled here */
uint nr; uint nr;
key_map keys_to_use, keys; key_map keys;
keys_to_use.set_all();
/* /*
If not used with LIMIT, only use keys if the whole query can be 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, ...@@ -7170,18 +7169,18 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
retrieving all rows through an index. retrieving all rows through an index.
*/ */
if (select_limit >= table->file->records) if (select_limit >= table->file->records)
{
keys= *table->file->keys_to_use_for_scanning();
keys.merge(table->used_keys);
nning(); /*
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.
ified in FORCE INDEX clause, */
if (table->force_index)
n ORDER BY. keys.merge(table->keys_in_use_for_query);
keys.intersect(usable_keys);
ry);
} }
else else
keys= usable_keys; keys= usable_keys;
......
...@@ -1669,13 +1669,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, ...@@ -1669,13 +1669,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
case HA_ADMIN_REJECT: case HA_ADMIN_REJECT:
protocol->store("status", 6, system_charset_info); protocol->store("status", 6, system_charset_info);
protocol->store("Operation need committed state",30, system_charset_info); protocol->store("Operation need committed state",30, system_charset_info);
open_for_modify= false; 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;
break; break;
case HA_ADMIN_ALREADY_DONE: case HA_ADMIN_ALREADY_DONE:
...@@ -2081,7 +2075,8 @@ int mysql_discard_or_import_tablespace(THD *thd, ...@@ -2081,7 +2075,8 @@ int mysql_discard_or_import_tablespace(THD *thd,
err: err:
close_thread_tables(thd); close_thread_tables(thd);
thd->tablespace_op=FALSE; thd->tablespace_op=FALSE;
if (error == 0) { if (error == 0)
{
send_ok(thd); send_ok(thd);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -2878,13 +2873,14 @@ copy_data_between_tables(TABLE *from,TABLE *to, ...@@ -2878,13 +2873,14 @@ copy_data_between_tables(TABLE *from,TABLE *to,
goto err; goto err;
}; };
/* Turn off recovery logging since rollback of an /*
alter table is to delete the new table so there Turn off recovery logging since rollback of an alter table is to
is no need to log the changes to it. */ delete the new table so there is no need to log the changes to it.
error = ha_recovery_logging(thd,FALSE); */
error= ha_recovery_logging(thd,FALSE);
if (error) if (error)
{ {
error = 1; error= 1;
goto err; goto err;
} }
......
...@@ -276,10 +276,14 @@ static void display_table_locks(void) ...@@ -276,10 +276,14 @@ static void display_table_locks(void)
THR_LOCK *lock=(THR_LOCK*) list->data; THR_LOCK *lock=(THR_LOCK*) list->data;
VOID(pthread_mutex_lock(&lock->mutex)); 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.data, FALSE,
push_locks_into_array(&saved_table_locks, lock->write_wait.data, true, "Waiting - write"); "Locked - write");
push_locks_into_array(&saved_table_locks, lock->read.data, false, "Locked - read"); push_locks_into_array(&saved_table_locks, lock->write_wait.data, TRUE,
push_locks_into_array(&saved_table_locks, lock->read_wait.data, true, "Waiting - read"); "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(&lock->mutex));
} }
VOID(pthread_mutex_unlock(&THR_LOCK_lock)); VOID(pthread_mutex_unlock(&THR_LOCK_lock));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment