Commit 6da39a4c authored by unknown's avatar unknown

Merge rurik.mysql.com:/home/igor/dev/mysql-5.0-0

into  rurik.mysql.com:/home/igor/dev/mysql-5.1-0


include/mysql.h:
  Auto merged
mysql-test/lib/mtr_timer.pl:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
sql-common/client.c:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/item.cc:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  Auto merged
storage/ndb/src/ndbapi/NdbTransaction.cpp:
  Auto merged
parents a242edb4 b0654461
...@@ -287,8 +287,10 @@ typedef struct st_mysql ...@@ -287,8 +287,10 @@ typedef struct st_mysql
from mysql_stmt_close if close had to cancel result set of this object. from mysql_stmt_close if close had to cancel result set of this object.
*/ */
my_bool *unbuffered_fetch_owner; my_bool *unbuffered_fetch_owner;
#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100
/* needed for embedded server - no net buffer to store the 'info' */ /* needed for embedded server - no net buffer to store the 'info' */
char *info_buffer; char *info_buffer;
#endif
} MYSQL; } MYSQL;
typedef struct st_mysql_res { typedef struct st_mysql_res {
......
...@@ -2553,3 +2553,12 @@ a b ...@@ -2553,3 +2553,12 @@ a b
3 3 3 3
drop view v2, v1; drop view v2, v1;
drop table t1; drop table t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1), (2);
CREATE VIEW v1 AS SELECT SQRT(a) my_sqrt FROM t1;
SELECT my_sqrt FROM v1 ORDER BY my_sqrt;
my_sqrt
1
1.4142135623731
DROP VIEW v1;
DROP TABLE t1;
...@@ -2404,3 +2404,17 @@ update v2 set b=3 where a=2; ...@@ -2404,3 +2404,17 @@ update v2 set b=3 where a=2;
select * from v2; select * from v2;
drop view v2, v1; drop view v2, v1;
drop table t1; drop table t1;
#
# Bug #18386: select from view over a table with ORDER BY view_col clause
# given view_col is not an image of any column from the base table
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1), (2);
CREATE VIEW v1 AS SELECT SQRT(a) my_sqrt FROM t1;
SELECT my_sqrt FROM v1 ORDER BY my_sqrt;
DROP VIEW v1;
DROP TABLE t1;
...@@ -92,17 +92,14 @@ port='@MYSQL_TCP_PORT@' ...@@ -92,17 +92,14 @@ port='@MYSQL_TCP_PORT@'
ldflags='@LDFLAGS@' ldflags='@LDFLAGS@'
# Create options # Create options
# We intentionally add a space to the beginning of lib strings, simplifies replace later
libs="$ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@" libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@"
libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@"
embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@"
libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! cflags="-I$pkgincludedir @CFLAGS@ " #note: end space!
include="-I$pkgincludedir" include="-I$pkgincludedir"
embedded_libs="$ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
# Remove some options that a client doesn't have to care about # Remove some options that a client doesn't have to care about
# FIXME until we have a --cxxflags, we need to remove -Xa # FIXME until we have a --cxxflags, we need to remove -Xa
...@@ -118,6 +115,20 @@ do ...@@ -118,6 +115,20 @@ do
done done
cflags=`echo "$cflags"|sed -e 's/ *\$//'` cflags=`echo "$cflags"|sed -e 's/ *\$//'`
# Same for --libs(_r)
for remove in lmtmalloc
do
# We know the strings starts with a space
libs=`echo "$libs"|sed -e "s/ -$remove */ /g"`
libs_r=`echo "$libs_r"|sed -e "s/ -$remove */ /g"`
embedded_libs=`echo "$embedded_libs"|sed -e "s/ -$remove */ /g"`
done
# Strip trailing and ending space if any, and '+' (FIXME why?)
libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
usage () { usage () {
cat <<EOF cat <<EOF
Usage: $0 [OPTIONS] Usage: $0 [OPTIONS]
......
...@@ -1428,13 +1428,7 @@ mysql_init(MYSQL *mysql) ...@@ -1428,13 +1428,7 @@ mysql_init(MYSQL *mysql)
mysql->free_me=1; mysql->free_me=1;
} }
else else
{
#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
bzero((char*) (mysql), sizeof(*(mysql))); bzero((char*) (mysql), sizeof(*(mysql)));
#else
bzero((char*) (mysql), offsetof(MYSQL, info_buffer));
#endif
}
mysql->options.connect_timeout= CONNECT_TIMEOUT; mysql->options.connect_timeout= CONNECT_TIMEOUT;
mysql->last_used_con= mysql->next_slave= mysql->master = mysql; mysql->last_used_con= mysql->next_slave= mysql->master = mysql;
mysql->charset=default_charset_info; mysql->charset=default_charset_info;
......
...@@ -5114,11 +5114,8 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference) ...@@ -5114,11 +5114,8 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
DESCRIPTION DESCRIPTION
A view column reference is considered equal to another column A view column reference is considered equal to another column
reference if the second one is a view column and if both column reference if the second one is a view column and if both column
references point to the same field. For views 'same field' means references resolve to the same item. It is assumed that both
the same Item_field object in the view translation table, where items are of the same type.
the view translation table contains all result columns of the
view. This definition ensures that view columns are resolved
in the same manner as table columns.
RETURN RETURN
TRUE Referenced item is equal to given item TRUE Referenced item is equal to given item
...@@ -5134,8 +5131,8 @@ bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const ...@@ -5134,8 +5131,8 @@ bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
if (item_ref->ref_type() == VIEW_REF) if (item_ref->ref_type() == VIEW_REF)
{ {
Item *item_ref_ref= *(item_ref->ref); Item *item_ref_ref= *(item_ref->ref);
DBUG_ASSERT((*ref)->real_item()->type() == FIELD_ITEM && DBUG_ASSERT((*ref)->real_item()->type() ==
(item_ref_ref->real_item()->type() == FIELD_ITEM)); item_ref_ref->real_item()->type());
return ((*ref)->real_item() == item_ref_ref->real_item()); return ((*ref)->real_item() == item_ref_ref->real_item());
} }
} }
......
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