Commit 70629938 authored by knielsen@rt.int.sifira.dk's avatar knielsen@rt.int.sifira.dk

Merge mysqldev@production:my/mysql-5.0-release

into  rt.int.sifira.dk:/usr/local/mysql/tmp-5.0
parents d2b378d5 1e4ccec8
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OptimizeForProcessor="2" OptimizeForProcessor="2"
AdditionalIncludeDirectories="../bdb/build_win32,../include,../regex,../extra/yassl/include,../zlib" AdditionalIncludeDirectories="../bdb/build_win32,../include,../regex,../extra/yassl/include,../zlib"
PreprocessorDefinitions="__NT__;NDEBUG;DBUG_OFF;USE_SYMDIR;HAVE_INNOBASE_DB;HAVE_BERKELEY_DB;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_WINDOWS;_CONSOLE;HAVE_DLOPEN" PreprocessorDefinitions="USE_SYMDIR;NDEBUG;DBUG_OFF;HAVE_INNOBASE_DB;HAVE_BERKELEY_DB;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_WINDOWS;_CONSOLE;HAVE_DLOPEN"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OptimizeForProcessor="2" OptimizeForProcessor="2"
AdditionalIncludeDirectories="../bdb/build_win32,../include,../regex,../extra/yassl/include,../zlib" AdditionalIncludeDirectories="../bdb/build_win32,../include,../regex,../extra/yassl/include,../zlib"
PreprocessorDefinitions="NDEBUG;__NT__;DBUG_OFF;HAVE_INNOBASE_DB;HAVE_BERKELEY_DB;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_WINDOWS;_CONSOLE;HAVE_DLOPEN" PreprocessorDefinitions="__NT__;NDEBUG;DBUG_OFF;HAVE_INNOBASE_DB;HAVE_BERKELEY_DB;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_WINDOWS;_CONSOLE;HAVE_DLOPEN"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
......
...@@ -597,7 +597,7 @@ extern gptr _my_memdup(const byte *from,uint length, ...@@ -597,7 +597,7 @@ extern gptr _my_memdup(const byte *from,uint length,
const char *sFile, uint uLine,myf MyFlag); const char *sFile, uint uLine,myf MyFlag);
extern my_string _my_strdup(const char *from, const char *sFile, uint uLine, extern my_string _my_strdup(const char *from, const char *sFile, uint uLine,
myf MyFlag); myf MyFlag);
extern char *_my_strdup_with_length(const byte *from, uint length, extern char *_my_strdup_with_length(const char *from, uint length,
const char *sFile, uint uLine, const char *sFile, uint uLine,
myf MyFlag); myf MyFlag);
......
...@@ -5,4 +5,7 @@ set -e ...@@ -5,4 +5,7 @@ set -e
args=" $*" args=" $*"
wine --debugmsg -all -- mwasmnlm $args # NOTE: Option 'pipefail' is not standard sh
set -o pipefail
wine --debugmsg -all -- mwasmnlm $args | \
perl -pe 's/\r//g; s/^\e.*\e(\[J|>)?//; s/[[^:print:]]//g'
...@@ -7,4 +7,7 @@ set -e ...@@ -7,4 +7,7 @@ set -e
# convert it to "-I../include" # convert it to "-I../include"
args=" "`echo $* | sed -e 's/-I.\/../-I../g'` args=" "`echo $* | sed -e 's/-I.\/../-I../g'`
wine --debugmsg -all -- mwccnlm $args # NOTE: Option 'pipefail' is not standard sh
set -o pipefail
wine --debugmsg -all -- mwccnlm $args | \
perl -pe 's/\r//g; s/^\e.*\e(\[J|>)?//; s/[[^:print:]]//g'
...@@ -5,4 +5,7 @@ set -e ...@@ -5,4 +5,7 @@ set -e
args=" $*" args=" $*"
wine --debugmsg -all -- mwldnlm $args # NOTE: Option 'pipefail' is not standard sh
set -o pipefail
wine --debugmsg -all -- mwldnlm $args | \
perl -pe 's/\r//g; s/^\e.*\e(\[J|>)?//; s/[[^:print:]]//g'
...@@ -1514,6 +1514,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , ...@@ -1514,6 +1514,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
*/ */
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
static void static void
mysql_ssl_free(MYSQL *mysql __attribute__((unused))) mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
{ {
...@@ -1538,6 +1539,7 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused))) ...@@ -1538,6 +1539,7 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#endif /* HAVE_OPENSSL */
/* /*
Return the SSL cipher (if any) used for current Return the SSL cipher (if any) used for current
...@@ -1553,8 +1555,10 @@ const char * STDCALL ...@@ -1553,8 +1555,10 @@ const char * STDCALL
mysql_get_ssl_cipher(MYSQL *mysql) mysql_get_ssl_cipher(MYSQL *mysql)
{ {
DBUG_ENTER("mysql_get_ssl_cipher"); DBUG_ENTER("mysql_get_ssl_cipher");
#ifdef HAVE_OPENSSL
if (mysql->net.vio && mysql->net.vio->ssl_arg) if (mysql->net.vio && mysql->net.vio->ssl_arg)
DBUG_RETURN(SSL_get_cipher_name((SSL*)mysql->net.vio->ssl_arg)); DBUG_RETURN(SSL_get_cipher_name((SSL*)mysql->net.vio->ssl_arg));
#endif /* HAVE_OPENSSL */
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
} }
...@@ -1573,6 +1577,9 @@ mysql_get_ssl_cipher(MYSQL *mysql) ...@@ -1573,6 +1577,9 @@ mysql_get_ssl_cipher(MYSQL *mysql)
1 Failed to validate server 1 Failed to validate server
*/ */
#ifdef HAVE_OPENSSL
static int ssl_verify_server_cert(Vio *vio, const char* server_hostname) static int ssl_verify_server_cert(Vio *vio, const char* server_hostname)
{ {
SSL *ssl; SSL *ssl;
......
...@@ -4584,7 +4584,8 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): ...@@ -4584,7 +4584,8 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
HA_NO_PREFIX_CHAR_KEYS | HA_NO_PREFIX_CHAR_KEYS |
HA_NEED_READ_RANGE_BUFFER | HA_NEED_READ_RANGE_BUFFER |
HA_CAN_GEOMETRY | HA_CAN_GEOMETRY |
HA_CAN_BIT_FIELD), HA_CAN_BIT_FIELD |
HA_PARTIAL_COLUMN_READ),
m_share(0), m_share(0),
m_use_write(FALSE), m_use_write(FALSE),
m_ignore_dup_key(FALSE), m_ignore_dup_key(FALSE),
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
see mi_rsame/heap_rsame/myrg_rsame see mi_rsame/heap_rsame/myrg_rsame
*/ */
#define HA_READ_RND_SAME (1 << 0) #define HA_READ_RND_SAME (1 << 0)
#define HA_PARTIAL_COLUMN_READ (1 << 1) /* read may not return all columns */
#define HA_TABLE_SCAN_ON_INDEX (1 << 2) /* No separate data/index file */ #define HA_TABLE_SCAN_ON_INDEX (1 << 2) /* No separate data/index file */
#define HA_REC_NOT_IN_SEQ (1 << 3) /* ha_info don't return recnumber; #define HA_REC_NOT_IN_SEQ (1 << 3) /* ha_info don't return recnumber;
It returns a position to ha_r_rnd */ It returns a position to ha_r_rnd */
......
...@@ -3303,7 +3303,7 @@ longlong Item_func_regex::val_int() ...@@ -3303,7 +3303,7 @@ longlong Item_func_regex::val_int()
} }
} }
null_value=0; null_value=0;
return my_regexec(&preg,res->c_ptr(),0,(my_regmatch_t*) 0,0) ? 0 : 1; return my_regexec(&preg,res->c_ptr_safe(),0,(my_regmatch_t*) 0,0) ? 0 : 1;
} }
......
...@@ -120,6 +120,7 @@ int mysql_update(THD *thd, ...@@ -120,6 +120,7 @@ int mysql_update(THD *thd,
bool using_limit= limit != HA_POS_ERROR; bool using_limit= limit != HA_POS_ERROR;
bool safe_update= thd->options & OPTION_SAFE_UPDATES; bool safe_update= thd->options & OPTION_SAFE_UPDATES;
bool used_key_is_modified, transactional_table; bool used_key_is_modified, transactional_table;
bool can_compare_record;
int res; int res;
int error; int error;
uint used_index= MAX_KEY; uint used_index= MAX_KEY;
...@@ -433,6 +434,13 @@ int mysql_update(THD *thd, ...@@ -433,6 +434,13 @@ int mysql_update(THD *thd,
(MODE_STRICT_TRANS_TABLES | (MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES))); MODE_STRICT_ALL_TABLES)));
/*
We can use compare_record() to optimize away updates if
the table handler is returning all columns
*/
can_compare_record= !(table->file->table_flags() &
HA_PARTIAL_COLUMN_READ);
while (!(error=info.read_record(&info)) && !thd->killed) while (!(error=info.read_record(&info)) && !thd->killed)
{ {
if (!(select && select->skip_record())) if (!(select && select->skip_record()))
...@@ -445,7 +453,7 @@ int mysql_update(THD *thd, ...@@ -445,7 +453,7 @@ int mysql_update(THD *thd,
found++; found++;
if (compare_record(table, query_id)) if (!can_compare_record || compare_record(table, query_id))
{ {
if ((res= table_list->view_check_option(thd, ignore)) != if ((res= table_list->view_check_option(thd, ignore)) !=
VIEW_CHECK_OK) VIEW_CHECK_OK)
...@@ -1248,8 +1256,15 @@ bool multi_update::send_data(List<Item> &not_used_values) ...@@ -1248,8 +1256,15 @@ bool multi_update::send_data(List<Item> &not_used_values)
uint offset= cur_table->shared; uint offset= cur_table->shared;
table->file->position(table->record[0]); table->file->position(table->record[0]);
/*
We can use compare_record() to optimize away updates if
the table handler is returning all columns
*/
if (table == table_to_update) if (table == table_to_update)
{ {
bool can_compare_record;
can_compare_record= !(table->file->table_flags() &
HA_PARTIAL_COLUMN_READ);
table->status|= STATUS_UPDATED; table->status|= STATUS_UPDATED;
store_record(table,record[1]); store_record(table,record[1]);
if (fill_record_n_invoke_before_triggers(thd, *fields_for_table[offset], if (fill_record_n_invoke_before_triggers(thd, *fields_for_table[offset],
...@@ -1259,7 +1274,7 @@ bool multi_update::send_data(List<Item> &not_used_values) ...@@ -1259,7 +1274,7 @@ bool multi_update::send_data(List<Item> &not_used_values)
DBUG_RETURN(1); DBUG_RETURN(1);
found++; found++;
if (compare_record(table, thd->query_id)) if (!can_compare_record || compare_record(table, thd->query_id))
{ {
int error; int error;
if ((error= cur_table->view_check_option(thd, ignore)) != if ((error= cur_table->view_check_option(thd, ignore)) !=
...@@ -1376,6 +1391,7 @@ int multi_update::do_updates(bool from_send_error) ...@@ -1376,6 +1391,7 @@ int multi_update::do_updates(bool from_send_error)
for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local) for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local)
{ {
byte *ref_pos; byte *ref_pos;
bool can_compare_record;
table = cur_table->table; table = cur_table->table;
if (table == table_to_update) if (table == table_to_update)
...@@ -1402,6 +1418,9 @@ int multi_update::do_updates(bool from_send_error) ...@@ -1402,6 +1418,9 @@ int multi_update::do_updates(bool from_send_error)
if ((local_error = tmp_table->file->ha_rnd_init(1))) if ((local_error = tmp_table->file->ha_rnd_init(1)))
goto err; goto err;
can_compare_record= !(table->file->table_flags() &
HA_PARTIAL_COLUMN_READ);
ref_pos= (byte*) tmp_table->field[0]->ptr; ref_pos= (byte*) tmp_table->field[0]->ptr;
for (;;) for (;;)
{ {
...@@ -1431,7 +1450,7 @@ int multi_update::do_updates(bool from_send_error) ...@@ -1431,7 +1450,7 @@ int multi_update::do_updates(bool from_send_error)
TRG_ACTION_BEFORE, TRUE)) TRG_ACTION_BEFORE, TRUE))
goto err2; goto err2;
if (compare_record(table, thd->query_id)) if (!can_compare_record || compare_record(table, thd->query_id))
{ {
if ((local_error=table->file->update_row(table->record[1], if ((local_error=table->file->update_row(table->record[1],
table->record[0]))) table->record[0])))
......
...@@ -42,8 +42,14 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ ...@@ -42,8 +42,14 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
LIBS = @CLIENT_LIBS@ LIBS = @CLIENT_LIBS@
LDADD = @CLIENT_EXTRA_LDFLAGS@ \ LDADD = @CLIENT_EXTRA_LDFLAGS@ \
$(top_builddir)/libmysql/libmysqlclient.la $(top_builddir)/libmysql/libmysqlclient.la
if HAVE_NETWARE
mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS)
mysql_client_test_SOURCES= mysql_client_test.c $(yassl_dummy_link_fix) \
../mysys/my_memmem.c
else
mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS) -L../mysys -lmysys mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS) -L../mysys -lmysys
mysql_client_test_SOURCES= mysql_client_test.c $(yassl_dummy_link_fix) mysql_client_test_SOURCES= mysql_client_test.c $(yassl_dummy_link_fix)
endif
insert_test_SOURCES= insert_test.c $(yassl_dummy_link_fix) insert_test_SOURCES= insert_test.c $(yassl_dummy_link_fix)
select_test_SOURCES= select_test.c $(yassl_dummy_link_fix) select_test_SOURCES= select_test.c $(yassl_dummy_link_fix)
insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
......
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