summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <jani@a193-229-222-105.elisa-laajakaista.fi>2005-11-23 14:57:00 +0200
committerunknown <jani@a193-229-222-105.elisa-laajakaista.fi>2005-11-23 14:57:00 +0200
commit33a2716a8539d9189622a6a5deef0d798c01b427 (patch)
treeee73c0781d75c64d0c74007e2d2a68f9de4b9a29 /sql/sql_select.cc
parent817ee181c34d53caf2179a978c35c685437fb756 (diff)
parent056d7266c7f3b10b2a054cb5bb534981e49408ee (diff)
downloadmariadb-git-33a2716a8539d9189622a6a5deef0d798c01b427.tar.gz
Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
into a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-new Makefile.am: Auto merged client/mysqltest.c: Auto merged configure.in: Auto merged extra/Makefile.am: Auto merged include/Makefile.am: Auto merged include/my_global.h: Auto merged libmysqld/examples/Makefile.am: Auto merged mysql-test/Makefile.am: Auto merged mysql-test/r/ndb_alter_table.result: Auto merged mysql-test/t/ndb_alter_table.test: Auto merged scripts/Makefile.am: Auto merged sql/Makefile.am: Auto merged sql/field.cc: Auto merged sql/ha_federated.cc: Auto merged sql/ha_federated.h: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item_subselect.cc: Auto merged sql/key.cc: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/structs.h: Auto merged sql/table.cc: Auto merged sql/tztime.cc: Auto merged storage/myisam/myisamchk.c: Auto merged storage/myisam/myisampack.c: Auto merged storage/ndb/docs/Makefile.am: Auto merged support-files/mysql.spec.sh: Auto merged libmysqld/Makefile.am: Merged from 5.0 to 5.1. sql/ha_berkeley.cc: Merged from 5.0 to 5.1. sql/lex.h: Merged from 5.0 to 5.1. sql/set_var.cc: Merged from 5.0 to 5.1. sql/share/errmsg.txt: Merged from 5.0 to 5.1. sql/sql_lex.h: Merged from 5.0 to 5.1. sql/sql_show.cc: Merged from 5.0 to 5.1. sql/sql_yacc.yy: Merged from 5.0 to 5.1.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc73
1 files changed, 39 insertions, 34 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index ad520302692..6ea9231c87c 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -13699,7 +13699,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{
SELECT_LEX *sl= join->unit->first_select();
uint len= 6, lastop= 0;
- memcpy(table_name_buffer, "<union", 6);
+ memcpy(table_name_buffer, STRING_WITH_LEN("<union"));
for (; sl && len + lastop + 5 < NAME_LEN; sl= sl->next_select())
{
len+= lastop;
@@ -13708,7 +13708,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
}
if (sl || len + lastop >= NAME_LEN)
{
- memcpy(table_name_buffer + len, "...>", 5);
+ memcpy(table_name_buffer + len, STRING_WITH_LEN("...>") + 1);
len+= 4;
}
else
@@ -13887,7 +13887,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
quick_type == QUICK_SELECT_I::QS_TYPE_ROR_INTERSECT ||
quick_type == QUICK_SELECT_I::QS_TYPE_INDEX_MERGE)
{
- extra.append("; Using ");
+ extra.append(STRING_WITH_LEN("; Using "));
tab->select->quick->add_info_string(&extra);
}
if (tab->select)
@@ -13895,7 +13895,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (tab->use_quick == 2)
{
char buf[MAX_KEY/8+1];
- extra.append("; Range checked for each record (index map: 0x");
+ extra.append(STRING_WITH_LEN("; Range checked for each "
+ "record (index map: 0x"));
extra.append(tab->keys.print(buf));
extra.append(')');
}
@@ -13905,38 +13906,39 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (thd->variables.engine_condition_pushdown && pushed_cond)
{
- extra.append("; Using where with pushed condition");
+ extra.append(STRING_WITH_LEN("; Using where with pushed "
+ "condition"));
if (thd->lex->describe & DESCRIBE_EXTENDED)
{
- extra.append(": ");
+ extra.append(STRING_WITH_LEN(": "));
((COND *)pushed_cond)->print(&extra);
}
}
else
- extra.append("; Using where");
+ extra.append(STRING_WITH_LEN("; Using where"));
}
}
if (key_read)
{
if (quick_type == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)
- extra.append("; Using index for group-by");
+ extra.append(STRING_WITH_LEN("; Using index for group-by"));
else
- extra.append("; Using index");
+ extra.append(STRING_WITH_LEN("; Using index"));
}
if (table->reginfo.not_exists_optimize)
- extra.append("; Not exists");
+ extra.append(STRING_WITH_LEN("; Not exists"));
if (need_tmp_table)
{
need_tmp_table=0;
- extra.append("; Using temporary");
+ extra.append(STRING_WITH_LEN("; Using temporary"));
}
if (need_order)
{
need_order=0;
- extra.append("; Using filesort");
+ extra.append(STRING_WITH_LEN("; Using filesort"));
}
if (distinct & test_all_bits(used_tables,thd->used_tables))
- extra.append("; Distinct");
+ extra.append(STRING_WITH_LEN("; Distinct"));
/* Skip initial "; "*/
const char *str= extra.ptr();
@@ -14053,15 +14055,18 @@ static void print_join(THD *thd, String *str, List<TABLE_LIST> *tables)
{
TABLE_LIST *curr= *tbl;
if (curr->outer_join)
- str->append(" left join ", 11); // MySQL converts right to left joins
+ {
+ /* MySQL converts right to left joins */
+ str->append(STRING_WITH_LEN(" left join "));
+ }
else if (curr->straight)
- str->append(" straight_join ", 15);
+ str->append(STRING_WITH_LEN(" straight_join "));
else
- str->append(" join ", 6);
+ str->append(STRING_WITH_LEN(" join "));
curr->print(thd, str);
if (curr->on_expr)
{
- str->append(" on(", 4);
+ str->append(STRING_WITH_LEN(" on("));
curr->on_expr->print(str);
str->append(')');
}
@@ -14146,28 +14151,28 @@ void st_select_lex::print(THD *thd, String *str)
if (!thd)
thd= current_thd;
- str->append("select ", 7);
+ str->append(STRING_WITH_LEN("select "));
/* First add options */
if (options & SELECT_STRAIGHT_JOIN)
- str->append("straight_join ", 14);
+ str->append(STRING_WITH_LEN("straight_join "));
if ((thd->lex->lock_option == TL_READ_HIGH_PRIORITY) &&
(this == &thd->lex->select_lex))
- str->append("high_priority ", 14);
+ str->append(STRING_WITH_LEN("high_priority "));
if (options & SELECT_DISTINCT)
- str->append("distinct ", 9);
+ str->append(STRING_WITH_LEN("distinct "));
if (options & SELECT_SMALL_RESULT)
- str->append("sql_small_result ", 17);
+ str->append(STRING_WITH_LEN("sql_small_result "));
if (options & SELECT_BIG_RESULT)
- str->append("sql_big_result ", 15);
+ str->append(STRING_WITH_LEN("sql_big_result "));
if (options & OPTION_BUFFER_RESULT)
- str->append("sql_buffer_result ", 18);
+ str->append(STRING_WITH_LEN("sql_buffer_result "));
if (options & OPTION_FOUND_ROWS)
- str->append("sql_calc_found_rows ", 20);
+ str->append(STRING_WITH_LEN("sql_calc_found_rows "));
if (!thd->lex->safe_to_cache_query)
- str->append("sql_no_cache ", 13);
+ str->append(STRING_WITH_LEN("sql_no_cache "));
if (options & OPTION_TO_QUERY_CACHE)
- str->append("sql_cache ", 10);
+ str->append(STRING_WITH_LEN("sql_cache "));
//Item List
bool first= 1;
@@ -14188,7 +14193,7 @@ void st_select_lex::print(THD *thd, String *str)
*/
if (table_list.elements)
{
- str->append(" from ", 6);
+ str->append(STRING_WITH_LEN(" from "));
/* go through join tree */
print_join(thd, str, &top_join_list);
}
@@ -14199,22 +14204,22 @@ void st_select_lex::print(THD *thd, String *str)
cur_where= join->conds;
if (cur_where)
{
- str->append(" where ", 7);
+ str->append(STRING_WITH_LEN(" where "));
cur_where->print(str);
}
// group by & olap
if (group_list.elements)
{
- str->append(" group by ", 10);
+ str->append(STRING_WITH_LEN(" group by "));
print_order(str, (ORDER *) group_list.first);
switch (olap)
{
case CUBE_TYPE:
- str->append(" with cube", 10);
+ str->append(STRING_WITH_LEN(" with cube"));
break;
case ROLLUP_TYPE:
- str->append(" with rollup", 12);
+ str->append(STRING_WITH_LEN(" with rollup"));
break;
default:
; //satisfy compiler
@@ -14228,13 +14233,13 @@ void st_select_lex::print(THD *thd, String *str)
if (cur_having)
{
- str->append(" having ", 8);
+ str->append(STRING_WITH_LEN(" having "));
cur_having->print(str);
}
if (order_list.elements)
{
- str->append(" order by ", 10);
+ str->append(STRING_WITH_LEN(" order by "));
print_order(str, (ORDER *) order_list.first);
}