1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Remove warnings and portability fixes

New global read lock code
Fixed bug in DATETIME with WHERE optimization
Made UNION code more general.


include/global.h:
  Remove warning on Linux Alpha
include/mysql_com.h:
  Move some C variables inside extern "C" block.
include/mysqld_error.h:
  New error mesages
myisam/mi_write.c:
  cleanup
mysql-test/r/select.result:
  Fix because of table lists now always has a database argument.
mysql-test/r/type_datetime.result:
  Test for bug with datetime and where optimization
mysql-test/r/union.result:
  Updated result
mysql-test/t/type_datetime.test:
  New test for datetime
mysql-test/t/union.test:
  More testing of error conditions
sql/item_sum.cc:
  Remove warnings on Linux Alpha
sql/item_sum.h:
  Cleanup
sql/lock.cc:
  Cleaned up global lock handling
sql/log_event.cc:
  Removed default arguments from declarations (not allowed in cxx)
sql/mysql_priv.h:
  New prototypes
sql/mysqld.cc:
  Fix for global locks
sql/opt_range.cc:
  Cleanup
sql/share/czech/errmsg.txt:
  New errors
sql/share/danish/errmsg.txt:
  New errors
sql/share/dutch/errmsg.txt:
  New errors
sql/share/english/errmsg.txt:
  New errors
sql/share/estonian/errmsg.txt:
  New errors
sql/share/french/errmsg.txt:
  New errors
sql/share/german/errmsg.txt:
  New errors
sql/share/greek/errmsg.txt:
  New errors
sql/share/hungarian/errmsg.txt:
  New errors
sql/share/italian/errmsg.txt:
  New errors
sql/share/japanese/errmsg.txt:
  New errors
sql/share/korean/errmsg.txt:
  New errors
sql/share/norwegian-ny/errmsg.txt:
  New errors
sql/share/norwegian/errmsg.txt:
  New errors
sql/share/polish/errmsg.txt:
  New errors
sql/share/portuguese/errmsg.txt:
  New errors
sql/share/romanian/errmsg.txt:
  New errors
sql/share/russian/errmsg.txt:
  New errors
sql/share/slovak/errmsg.txt:
  New errors
sql/share/spanish/errmsg.txt:
  New errors
sql/share/swedish/errmsg.OLD:
  New errors
sql/share/swedish/errmsg.txt:
  New errors
sql/sql_acl.cc:
  Use thd->host_or_ip
sql/sql_class.cc:
  Use new global lock code
sql/sql_class.h:
  host_or_ip
sql/sql_db.cc:
  host_or_ip
sql/sql_delete.cc:
  Use now global lock code
sql/sql_lex.h:
  Cleanup of not used states and variables
sql/sql_parse.cc:
  Use now global locks.
  Made UNION code more general.
  Change to use thd->hosts_or_ip.
  TABLE_LIST now always has 'db' set.
sql/sql_repl.cc:
  Portability fixes.
  Changed wrong usage of my_vsnprintf -> my_snprintf
sql/sql_select.cc:
  Changes for UNION
sql/sql_show.cc:
  Cleanup
sql/sql_union.cc:
  Handle 'select_result' outside of mysql_union().
sql/sql_yacc.yy:
  Fixes for union
This commit is contained in:
unknown
2001-08-14 20:33:49 +03:00
parent 97250b9c40
commit 410dd0779c
50 changed files with 541 additions and 547 deletions

View File

@@ -25,21 +25,34 @@
#include "sql_select.h"
int mysql_union(THD *thd, LEX *lex,select_result *create_insert=(select_result *)NULL)
int mysql_union(THD *thd, LEX *lex,select_result *result)
{
SELECT_LEX *sl, *last_sl;
ORDER *order;
List<Item> item_list;
/* TABLE_LIST *s=(TABLE_LIST*) lex->select_lex.table_list.first; */
TABLE *table;
TABLE_LIST *first_table, result_table_list;
TMP_TABLE_PARAM tmp_table_param;
select_result *result;
select_union *union_result;
int res;
uint elements;
DBUG_ENTER("mysql_union");
if (lex->select_lex.options & SELECT_DESCRIBE)
{
my_error(ER_WRONG_USAGE,MYF(0),"DESCRIBE","UNION");
return -1;
}
/* Fix tables--to-be-unioned-from list to point at opened tables */
for (sl=&lex->select_lex; sl; sl=sl->next)
{
for (TABLE_LIST *cursor= (TABLE_LIST *)sl->table_list.first;
cursor;
cursor=cursor->next)
cursor->table= ((TABLE_LIST*) cursor->table)->table;
}
/* Find last select part as it's here ORDER BY and GROUP BY is stored */
elements= lex->select_lex.item_list.elements;
for (last_sl= &lex->select_lex;
@@ -60,7 +73,6 @@ int mysql_union(THD *thd, LEX *lex,select_result *create_insert=(select_result *
/* Create a list of items that will be in the result set */
first_table= (TABLE_LIST*) lex->select_lex.table_list.first;
if (create_insert) first_table=first_table->next;
while ((item= it++))
if (item_list.push_back(item))
DBUG_RETURN(-1);
@@ -96,8 +108,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *create_insert=(select_result *
if (thd->select_limit == HA_POS_ERROR)
sl->options&= ~OPTION_FOUND_ROWS;
res=mysql_select(thd,(sl == &lex->select_lex) ? first_table :
(TABLE_LIST*) sl->table_list.first,
res=mysql_select(thd, (TABLE_LIST*) sl->table_list.first,
sl->item_list,
sl->where,
sl->ftfunc_list,
@@ -116,19 +127,9 @@ int mysql_union(THD *thd, LEX *lex,select_result *create_insert=(select_result *
goto exit;
}
delete union_result;
if (create_insert)
result=create_insert;
else if (lex->exchange)
{
if (lex->exchange->dumpfile)
result=new select_dump(lex->exchange);
else
result=new select_export(lex->exchange);
}
else
result=new select_send();
/* Send result to 'result' */
res =-1;
if (result)
{
/* Create a list of fields in the temporary table */
List_iterator<Item> it(item_list);
@@ -146,9 +147,6 @@ int mysql_union(THD *thd, LEX *lex,select_result *create_insert=(select_result *
item_list, NULL, ftfunc_list, order,
(ORDER*) NULL, NULL, (ORDER*) NULL,
thd->options, result);
if (res)
result->abort();
delete result;
}
exit: