Commit 08bb033b authored by unknown's avatar unknown

merged

mysql-test/r/create.result:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
parents 93e1bbf6 654d266c
LIBRARY LIBMYSQL
DESCRIPTION 'MySQL 3.23 Client Library'
VERSION 2.5
EXPORTS
mysql_affected_rows
mysql_close
mysql_connect
mysql_create_db
mysql_data_seek
mysql_debug
mysql_drop_db
mysql_dump_debug_info
mysql_eof
mysql_errno
mysql_error
mysql_escape_string
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
mysql_fetch_lengths
mysql_fetch_row
mysql_field_count
mysql_field_seek
mysql_field_tell
mysql_free_result
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_info
mysql_init
mysql_insert_id
mysql_kill
mysql_list_dbs
mysql_list_fields
mysql_list_processes
mysql_list_tables
mysql_num_fields
mysql_num_rows
mysql_odbc_escape_string
mysql_options
mysql_ping
mysql_query
mysql_real_connect
mysql_real_query
mysql_refresh
mysql_row_seek
mysql_row_tell
mysql_select_db
mysql_shutdown
mysql_stat
mysql_store_result
mysql_thread_id
mysql_use_result
bmove_upp
delete_dynamic
_dig_vec
init_dynamic_array
insert_dynamic
int2str
is_prefix
list_add
list_delete
max_allowed_packet
my_casecmp
my_init
my_end
my_strdup
my_malloc
my_memdup
my_no_flags_free
my_realloc
my_thread_end
my_thread_init
net_buffer_length
set_dynamic
strcend
strdup_root
strfill
strinstr
strmake
strmov
strxmov
myodbc_remove_escape
mysql_thread_safe
mysql_character_set_name
mysql_change_user
mysql_send_query
mysql_read_query_result
mysql_real_escape_string
load_defaults
free_defaults
VC++Files/mysqlshutdown/mysql.ico

318 Bytes

This diff is collapsed.
MySql ICON DISCARDABLE "MYSQL.ICO"
MySql ICON DISCARDABLE "MYSQL.ICO"
This diff is collapsed.
This diff is collapsed.
......@@ -2328,7 +2328,7 @@ com_status(String *buffer __attribute__((unused)),
(result=mysql_use_result(&mysql)))
{
MYSQL_ROW cur=mysql_fetch_row(result);
tee_fprintf(stdout, "Current database:\t%s\n",cur[0]);
tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
tee_fprintf(stdout, "Current user:\t\t%s\n",cur[1]);
(void) mysql_fetch_row(result); // Read eof
}
......
......@@ -40,6 +40,7 @@ static FILE *result_file;
#ifndef DBUG_OFF
static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
#endif
static const char *load_default_groups[]= { "mysqlbinlog","client",0 };
void sql_print_error(const char *format, ...);
......@@ -278,7 +279,7 @@ static void die(const char* fmt, ...)
static void print_version()
{
printf("%s Ver 2.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
printf("%s Ver 2.4 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
}
......@@ -374,6 +375,7 @@ static int parse_args(int *argc, char*** argv)
int ho_error;
result_file = stdout;
load_defaults("my",load_default_groups,argc,argv);
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
......@@ -743,12 +745,16 @@ void free_tmpdir(MY_TMPDIR *tmpdir)
int main(int argc, char** argv)
{
static char **defaults_argv;
MY_INIT(argv[0]);
parse_args(&argc, (char***)&argv);
defaults_argv=argv;
if (!argc)
{
usage();
free_defaults(defaults_argv);
return -1;
}
......@@ -778,6 +784,8 @@ int main(int argc, char** argv)
my_fclose(result_file, MYF(0));
if (use_remote)
mysql_close(mysql);
free_defaults(defaults_argv);
my_end(0);
return 0;
}
......
......@@ -37,7 +37,7 @@ extern int h_errno;
#endif
#ifndef HAVE_IN_ADDR_T
#define in_addr_t u_long
#define in_addr_t ulong
#endif
static my_bool silent;
......
......@@ -2190,6 +2190,9 @@ row_rename_table_for_mysql(
mem_heap_t* heap = NULL;
char** constraints_to_drop = NULL;
ulint n_constraints_to_drop = 0;
ibool recovering_temp_table = FALSE;
ulint namelen;
ulint keywordlen;
ulint len;
ulint i;
char buf[10000];
......@@ -2226,10 +2229,23 @@ row_rename_table_for_mysql(
trx->op_info = (char *) "renaming table";
trx_start_if_not_started(trx);
namelen = ut_strlen(new_name);
keywordlen = ut_strlen("_recover_innodb_tmp_table");
if (namelen >= keywordlen
&& 0 == ut_memcmp(new_name + namelen - keywordlen,
(char*)"_recover_innodb_tmp_table", keywordlen)) {
recovering_temp_table = TRUE;
}
/* Serialize data dictionary operations with dictionary mutex:
no deadlocks can occur then in these operations */
row_mysql_lock_data_dictionary(trx);
if (!recovering_temp_table) {
row_mysql_lock_data_dictionary(trx);
}
table = dict_table_get_low(old_name);
......@@ -2396,8 +2412,10 @@ row_rename_table_for_mysql(
}
}
}
funct_exit:
row_mysql_unlock_data_dictionary(trx);
funct_exit:
if (!recovering_temp_table) {
row_mysql_unlock_data_dictionary(trx);
}
if (graph) {
que_graph_free(graph);
......
......@@ -429,14 +429,14 @@ if [ x$SOURCE_DIST = x1 ] ; then
MYSQL_TEST="$BASEDIR/client/mysqltest"
fi
if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK"
MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
else
MYSQL_DUMP="$BASEDIR/client/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK"
MYSQL_DUMP="$BASEDIR/client/mysqldump"
fi
if [ -f "$BASEDIR/client/.libs/mysqlbinlog" ] ; then
MYSQL_BINLOG="$BASEDIR/client/.libs/mysqlbinlog --local-load=$MYSQL_TMP_DIR"
MYSQL_BINLOG="$BASEDIR/client/.libs/mysqlbinlog"
else
MYSQL_BINLOG="$BASEDIR/client/mysqlbinlog --local-load=$MYSQL_TMP_DIR"
MYSQL_BINLOG="$BASEDIR/client/mysqlbinlog"
fi
if [ -n "$STRACE_CLIENT" ]; then
MYSQL_TEST="strace -o $MYSQL_TEST_DIR/var/log/mysqltest.strace $MYSQL_TEST"
......@@ -459,8 +459,8 @@ else
MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
fi
MYSQL_TEST="$BASEDIR/bin/mysqltest"
MYSQL_DUMP="$BASEDIR/bin/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK"
MYSQL_BINLOG="$BASEDIR/bin/mysqlbinlog --local-load=$MYSQL_TMP_DIR"
MYSQL_DUMP="$BASEDIR/bin/mysqldump"
MYSQL_BINLOG="$BASEDIR/bin/mysqlbinlog"
MYSQLADMIN="$BASEDIR/bin/mysqladmin"
WAIT_PID="$BASEDIR/bin/mysql_waitpid"
MYSQL_MANAGER="$BASEDIR/bin/mysqlmanager"
......@@ -478,6 +478,8 @@ else
fi
fi
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR"
export MYSQL_DUMP
export MYSQL_BINLOG
......@@ -1041,7 +1043,7 @@ EOF
mysql_start ()
{
# We should not start the daemon here as we don't know the argumens
# We should not start the daemon here as we don't know the arguments
# for the test. Better to let the test start the daemon
# $ECHO "Starting MySQL daemon"
......
......@@ -78,7 +78,7 @@ Field Type Null Key Default Extra
x varchar(50) YES NULL
describe t2;
Field Type Null Key Default Extra
x char(50) YES NULL
x varchar(50) YES NULL
drop table t2;
create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
describe t2;
......
......@@ -10,5 +10,5 @@ reset slave;
start slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.002 4 slave-relay-bin.002 161 master-bin.001 Yes No 0 there is an unfinished transaction in the relay log (could find neither COMMIT nor ROLLBACK in the relay log); it could be that the master died while writing the transaction to its binary log. Now the slave is rolling back the transaction. 0 79 317
127.0.0.1 root MASTER_PORT 1 master-bin.002 4 slave-relay-bin.002 161 master-bin.001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. Probably cause is that the master died while writing the transaction to it's binary log. 0 79 317
reset master;
......@@ -6,6 +6,10 @@
source include/master-slave.inc;
connection slave;
# If we are not supporting transactions in the slave, the unfinished transaction
# won't cause any error, so we need to skip the test. In the 4.0 testsuite, the
# slave always runs without InnoDB, so we check for BDB.
source include/have_bdb.inc;
stop slave;
connection master;
flush logs;
......
/*C4*/
/****************************************************************/
/* Author: Jethro Wright, III TS : 3/ 4/1998 9:15 */
/* Date: 02/18/1998 */
/* mytest.c : do some testing of the libmySQL.DLL.... */
/* */
/* History: */
/* 02/18/1998 jw3 also sprach zarathustra.... */
/****************************************************************/
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <mysql.h>
#define DEFALT_SQL_STMT "SELECT * FROM db"
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
/********************************************************
**
** main :-
**
********************************************************/
int
main( int argc, char * argv[] )
{
char szSQL[ 200 ], aszFlds[ 25 ][ 25 ], * pszT, szDB[ 50 ] ;
int i, j, k, l, x ;
MYSQL * myData ;
MYSQL_RES * res ;
MYSQL_FIELD * fd ;
MYSQL_ROW row ;
//....just curious....
printf( "sizeof( MYSQL ) == %d\n", sizeof( MYSQL ) ) ;
if ( argc == 2 )
{
strcpy( szDB, argv[ 1 ] ) ;
strcpy( szSQL, DEFALT_SQL_STMT ) ;
if (!strcmp(szDB,"--debug"))
{
strcpy( szDB, "mysql" ) ;
printf("Some mysql struct information (size and offset):\n");
printf("net:\t%3d %3d\n",sizeof(myData->net),offsetof(MYSQL,net));
printf("host:\t%3d %3d\n",sizeof(myData->host),offsetof(MYSQL,host));
printf("port:\t%3d %3d\n",sizeof(myData->port),offsetof(MYSQL,port));
printf("protocol_version:\t%3d %3d\n",sizeof(myData->protocol_version),
offsetof(MYSQL,protocol_version));
printf("thread_id:\t%3d %3d\n",sizeof(myData->thread_id),
offsetof(MYSQL,thread_id));
printf("affected_rows:\t%3d %3d\n",sizeof(myData->affected_rows),
offsetof(MYSQL,affected_rows));
printf("packet_length:\t%3d %3d\n",sizeof(myData->packet_length),
offsetof(MYSQL,packet_length));
printf("status:\t%3d %3d\n",sizeof(myData->status),
offsetof(MYSQL,status));
printf("fields:\t%3d %3d\n",sizeof(myData->fields),
offsetof(MYSQL,fields));
printf("field_alloc:\t%3d %3d\n",sizeof(myData->field_alloc),
offsetof(MYSQL,field_alloc));
printf("free_me:\t%3d %3d\n",sizeof(myData->free_me),
offsetof(MYSQL,free_me));
printf("options:\t%3d %3d\n",sizeof(myData->options),
offsetof(MYSQL,options));
puts("");
}
}
else if ( argc > 2 ) {
strcpy( szDB, argv[ 1 ] ) ;
strcpy( szSQL, argv[ 2 ] ) ;
}
else {
strcpy( szDB, "mysql" ) ;
strcpy( szSQL, DEFALT_SQL_STMT ) ;
}
//....
if ( (myData = mysql_init((MYSQL*) 0)) &&
mysql_real_connect( myData, NULL, NULL, NULL, NULL, MYSQL_PORT,
NULL, 0 ) )
{
if ( mysql_select_db( myData, szDB ) < 0 ) {
printf( "Can't select the %s database !\n", szDB ) ;
mysql_close( myData ) ;
return 2 ;
}
}
else {
printf( "Can't connect to the mysql server on port %d !\n",
MYSQL_PORT ) ;
mysql_close( myData ) ;
return 1 ;
}
//....
if ( ! mysql_query( myData, szSQL ) ) {
res = mysql_store_result( myData ) ;
i = (int) mysql_num_rows( res ) ; l = 1 ;
printf( "Query: %s\nNumber of records found: %ld\n", szSQL, i ) ;
//....we can get the field-specific characteristics here....
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
strcpy( aszFlds[ x ], fd->name ) ;
//....
while ( row = mysql_fetch_row( res ) ) {
j = mysql_num_fields( res ) ;
printf( "Record #%ld:-\n", l++ ) ;
for ( k = 0 ; k < j ; k++ )
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
puts( "==============================\n" ) ;
}
mysql_free_result( res ) ;
}
else printf( "Couldn't execute %s on the server !\n", szSQL ) ;
//....
puts( "==== Diagnostic info ====" ) ;
pszT = mysql_get_client_info() ;
printf( "Client info: %s\n", pszT ) ;
//....
pszT = mysql_get_host_info( myData ) ;
printf( "Host info: %s\n", pszT ) ;
//....
pszT = mysql_get_server_info( myData ) ;
printf( "Server info: %s\n", pszT ) ;
//....
res = mysql_list_processes( myData ) ; l = 1 ;
if (res)
{
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
strcpy( aszFlds[ x ], fd->name ) ;
while ( row = mysql_fetch_row( res ) ) {
j = mysql_num_fields( res ) ;
printf( "Process #%ld:-\n", l++ ) ;
for ( k = 0 ; k < j ; k++ )
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
puts( "==============================\n" ) ;
}
}
else
{
printf("Got error %s when retreiving processlist\n",mysql_error(myData));
}
//....
res = mysql_list_tables( myData, "%" ) ; l = 1 ;
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
strcpy( aszFlds[ x ], fd->name ) ;
while ( row = mysql_fetch_row( res ) ) {
j = mysql_num_fields( res ) ;
printf( "Table #%ld:-\n", l++ ) ;
for ( k = 0 ; k < j ; k++ )
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
puts( "==============================\n" ) ;
}
//....
pszT = mysql_stat( myData ) ;
puts( pszT ) ;
//....
mysql_close( myData ) ;
return 0 ;
}
......@@ -17,7 +17,6 @@
## Process this file with automake to create Makefile.in
bin_SCRIPTS = @server_scripts@ \
make_win_src_distribution \
msql2mysql \
mysql_config \
mysql_fix_privilege_tables \
......@@ -33,7 +32,8 @@ bin_SCRIPTS = @server_scripts@ \
mysqldumpslow \
mysql_explain_log \
mysql_tableinfo \
mysqld_multi
mysqld_multi \
make_win_src_distribution
EXTRA_SCRIPTS = make_binary_distribution.sh \
make_win_src_distribution.sh \
......@@ -66,7 +66,6 @@ pkgdata_DATA = make_binary_distribution
# failures with it.
CLEANFILES = @server_scripts@ \
make_binary_distribution \
make_win_src_distribution \
msql2mysql \
mysql_config \
mysql_fix_privilege_tables \
......@@ -79,7 +78,8 @@ CLEANFILES = @server_scripts@ \
mysql_find_rows \
mysqlhotcopy \
mysqldumpslow \
mysqld_multi
mysqld_multi \
make_win_src_distribution
SUPERCLEANFILES = mysqlbug
......
......@@ -136,7 +136,7 @@ then
fi
fi
if test "$ip_only" -eq 1
if test "$ip_only" ="1"
then
ip=`echo "$resolved" | awk '/ /{print $6}'`
hostname=$ip
......
......@@ -2102,10 +2102,10 @@ int Start_log_event::exec_event(struct st_relay_log_info* rli)
if (rli->inside_transaction)
{
slave_print_error(rli, 0,
"there is an unfinished transaction in the relay log \
(could find neither COMMIT nor ROLLBACK in the relay log); it could be that \
the master died while writing the transaction to its binary log. Now the slave \
is rolling back the transaction.");
"\
Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. \
Probably cause is that the master died while writing the transaction to it's \
binary log.");
return(1);
}
break;
......@@ -2208,7 +2208,7 @@ int Rotate_log_event::exec_event(struct st_relay_log_info* rli)
{
memcpy(rli->master_log_name, new_log_ident, ident_len+1);
rli->master_log_pos= pos;
DBUG_PRINT("info", ("master_log_pos: %d", (ulong) rli->master_log_pos));
DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) rli->master_log_pos));
}
rli->relay_log_pos += get_event_len();
pthread_mutex_unlock(&rli->data_lock);
......
......@@ -3706,6 +3706,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
new_field->field_name=item->name;
if (org_field->maybe_null())
new_field->flags&= ~NOT_NULL_FLAG; // Because of outer join
if (org_field->type()==FIELD_TYPE_VAR_STRING)
table->db_create_options|= HA_OPTION_PACK_RECORD;
}
return new_field;
}
......
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