Merge bodhi.local:/opt/local/work/tmp_merge
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0
This commit is contained in:
commit
d7845b74db
@ -1093,6 +1093,7 @@ scripts/mysql_secure_installation
|
||||
scripts/mysql_setpermission
|
||||
scripts/mysql_tableinfo
|
||||
scripts/mysql_upgrade
|
||||
scripts/mysql_upgrade_shell
|
||||
scripts/mysql_zap
|
||||
scripts/mysqlaccess
|
||||
scripts/mysqlbug
|
||||
|
@ -358,18 +358,18 @@ fi
|
||||
AC_SUBST(LD_VERSION_SCRIPT)
|
||||
|
||||
# Avoid bug in fcntl on some versions of linux
|
||||
AC_MSG_CHECKING("if we should use 'skip-locking' as default for $target_os")
|
||||
AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
|
||||
# Any variation of Linux
|
||||
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
|
||||
then
|
||||
MYSQLD_DEFAULT_SWITCHES="--skip-locking"
|
||||
MYSQLD_DEFAULT_SWITCHES="--skip-external-locking"
|
||||
TARGET_LINUX="true"
|
||||
AC_MSG_RESULT("yes")
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
|
||||
else
|
||||
MYSQLD_DEFAULT_SWITCHES=""
|
||||
TARGET_LINUX="false"
|
||||
AC_MSG_RESULT("no")
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
|
||||
AC_SUBST(TARGET_LINUX)
|
||||
|
@ -1159,8 +1159,8 @@ do { doubleget_union _tmp; \
|
||||
#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \
|
||||
*(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \
|
||||
} while (0)
|
||||
#define float4get(V,M) do { *((long *) &(V)) = *((long*) (M)); } while(0)
|
||||
#define float8get(V,M) doubleget((V),(M))
|
||||
#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0)
|
||||
#define float8get(V,M) doubleget((V),(M))
|
||||
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
|
||||
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float))
|
||||
#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float))
|
||||
|
@ -18,7 +18,6 @@
|
||||
#ifndef _my_handler_h
|
||||
#define _my_handler_h
|
||||
|
||||
#include "my_global.h"
|
||||
#include "my_base.h"
|
||||
#include "m_ctype.h"
|
||||
#include "myisampack.h"
|
||||
|
@ -2385,10 +2385,9 @@ static void net_store_datetime(NET *net, MYSQL_TIME *tm)
|
||||
|
||||
static void store_param_date(NET *net, MYSQL_BIND *param)
|
||||
{
|
||||
MYSQL_TIME *tm= (MYSQL_TIME *) param->buffer;
|
||||
tm->hour= tm->minute= tm->second= 0;
|
||||
tm->second_part= 0;
|
||||
net_store_datetime(net, tm);
|
||||
MYSQL_TIME tm= *((MYSQL_TIME *) param->buffer);
|
||||
tm.hour= tm.minute= tm.second= tm.second_part= 0;
|
||||
net_store_datetime(net, &tm);
|
||||
}
|
||||
|
||||
static void store_param_datetime(NET *net, MYSQL_BIND *param)
|
||||
|
@ -15,6 +15,7 @@
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
|
||||
#include <my_global.h>
|
||||
#include "my_handler.h"
|
||||
|
||||
int mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length,
|
||||
|
@ -34,7 +34,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="wsock32.lib"
|
||||
OutputFile="$(OutDir)/mysqlmanager.exe"
|
||||
OutputFile="../../client_debug/mysqlmanager.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/mysqlmanager.pdb"
|
||||
@ -82,7 +82,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="wsock32.lib"
|
||||
OutputFile="$(OutDir)/mysqlmanager.exe"
|
||||
OutputFile="../../client_release/mysqlmanager.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
|
@ -2629,9 +2629,10 @@ int ha_ndbcluster::write_row(byte *record)
|
||||
{
|
||||
Ndb *ndb= get_ndb();
|
||||
Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1;
|
||||
char buff[22];
|
||||
DBUG_PRINT("info",
|
||||
("Trying to set next auto increment value to %llu",
|
||||
(ulonglong) next_val));
|
||||
("Trying to set next auto increment value to %s",
|
||||
llstr(next_val, buff)));
|
||||
Ndb_tuple_id_range_guard g(m_share);
|
||||
if (ndb->setAutoIncrementValue(m_table, g.range, next_val, TRUE)
|
||||
== -1)
|
||||
@ -3065,11 +3066,13 @@ void ha_ndbcluster::unpack_record(byte *buf)
|
||||
// Table with hidden primary key
|
||||
int hidden_no= table_share->fields;
|
||||
const NDBTAB *tab= m_table;
|
||||
char buff[22];
|
||||
const NDBCOL *hidden_col= tab->getColumn(hidden_no);
|
||||
const NdbRecAttr* rec= m_value[hidden_no].rec;
|
||||
DBUG_ASSERT(rec);
|
||||
DBUG_PRINT("hidden", ("%d: %s \"%llu\"", hidden_no,
|
||||
hidden_col->getName(), rec->u_64_value()));
|
||||
DBUG_PRINT("hidden", ("%d: %s \"%s\"", hidden_no,
|
||||
hidden_col->getName(),
|
||||
llstr(rec->u_64_value(), buff)));
|
||||
}
|
||||
//DBUG_EXECUTE("value", print_results(););
|
||||
#endif
|
||||
@ -4504,10 +4507,11 @@ static int create_ndb_column(NDBCOL &col,
|
||||
// Set autoincrement
|
||||
if (field->flags & AUTO_INCREMENT_FLAG)
|
||||
{
|
||||
char buff[22];
|
||||
col.setAutoIncrement(TRUE);
|
||||
ulonglong value= info->auto_increment_value ?
|
||||
info->auto_increment_value : (ulonglong) 1;
|
||||
DBUG_PRINT("info", ("Autoincrement key, initial: %llu", value));
|
||||
DBUG_PRINT("info", ("Autoincrement key, initial: %s", llstr(value, buff)));
|
||||
col.setAutoIncrementInitialValue(value);
|
||||
}
|
||||
else
|
||||
@ -6824,8 +6828,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
if (share->commit_count != 0)
|
||||
{
|
||||
*commit_count= share->commit_count;
|
||||
DBUG_PRINT("info", ("Getting commit_count: %llu from share",
|
||||
share->commit_count));
|
||||
char buff[22];
|
||||
DBUG_PRINT("info", ("Getting commit_count: %s from share",
|
||||
llstr(share->commit_count, buff)));
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
free_share(&share);
|
||||
DBUG_RETURN(0);
|
||||
@ -6853,7 +6858,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
if (share->commit_count_lock == lock)
|
||||
{
|
||||
DBUG_PRINT("info", ("Setting commit_count to %llu", stat.commit_count));
|
||||
char buff[22];
|
||||
DBUG_PRINT("info", ("Setting commit_count to %s",
|
||||
llstr(stat.commit_count, buff)));
|
||||
share->commit_count= stat.commit_count;
|
||||
*commit_count= stat.commit_count;
|
||||
}
|
||||
@ -6903,13 +6910,12 @@ ndbcluster_cache_retrieval_allowed(THD *thd,
|
||||
char *full_name, uint full_name_len,
|
||||
ulonglong *engine_data)
|
||||
{
|
||||
DBUG_ENTER("ndbcluster_cache_retrieval_allowed");
|
||||
|
||||
Uint64 commit_count;
|
||||
bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
|
||||
char *dbname= full_name;
|
||||
char *tabname= dbname+strlen(dbname)+1;
|
||||
|
||||
char buff[22], buff2[22];
|
||||
DBUG_ENTER("ndbcluster_cache_retrieval_allowed");
|
||||
DBUG_PRINT("enter", ("dbname: %s, tabname: %s, is_autocommit: %d",
|
||||
dbname, tabname, is_autocommit));
|
||||
|
||||
@ -6925,8 +6931,8 @@ ndbcluster_cache_retrieval_allowed(THD *thd,
|
||||
DBUG_PRINT("exit", ("No, could not retrieve commit_count"));
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
DBUG_PRINT("info", ("*engine_data: %llu, commit_count: %llu",
|
||||
*engine_data, commit_count));
|
||||
DBUG_PRINT("info", ("*engine_data: %s, commit_count: %s",
|
||||
llstr(*engine_data, buff), llstr(commit_count, buff2)));
|
||||
if (commit_count == 0)
|
||||
{
|
||||
*engine_data= 0; /* invalidate */
|
||||
@ -6940,7 +6946,8 @@ ndbcluster_cache_retrieval_allowed(THD *thd,
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
DBUG_PRINT("exit", ("OK to use cache, engine_data: %llu", *engine_data));
|
||||
DBUG_PRINT("exit", ("OK to use cache, engine_data: %s",
|
||||
llstr(*engine_data, buff)));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
@ -6973,10 +6980,10 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
|
||||
qc_engine_callback *engine_callback,
|
||||
ulonglong *engine_data)
|
||||
{
|
||||
DBUG_ENTER("ha_ndbcluster::register_query_cache_table");
|
||||
|
||||
Uint64 commit_count;
|
||||
char buff[22];
|
||||
bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
|
||||
|
||||
DBUG_ENTER("ha_ndbcluster::register_query_cache_table");
|
||||
DBUG_PRINT("enter",("dbname: %s, tabname: %s, is_autocommit: %d",
|
||||
m_dbname, m_tabname, is_autocommit));
|
||||
|
||||
@ -6986,7 +6993,6 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
Uint64 commit_count;
|
||||
if (ndb_get_commitcount(thd, m_dbname, m_tabname, &commit_count))
|
||||
{
|
||||
*engine_data= 0;
|
||||
@ -6995,7 +7001,7 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
|
||||
}
|
||||
*engine_data= commit_count;
|
||||
*engine_callback= ndbcluster_cache_retrieval_allowed;
|
||||
DBUG_PRINT("exit", ("commit_count: %llu", commit_count));
|
||||
DBUG_PRINT("exit", ("commit_count: %s", llstr(commit_count, buff)));
|
||||
DBUG_RETURN(commit_count > 0);
|
||||
}
|
||||
|
||||
@ -7417,6 +7423,9 @@ ndb_get_table_statistics(Ndb* ndb, const NDBTAB *ndbtab,
|
||||
NdbError error;
|
||||
int retries= 10;
|
||||
int retry_sleep= 30 * 1000; /* 30 milliseconds */
|
||||
char buff[22], buff2[22], buff3[22], buff4[22];
|
||||
DBUG_ENTER("ndb_get_table_statistics");
|
||||
DBUG_PRINT("enter", ("table: %s", table));
|
||||
|
||||
DBUG_ASSERT(ndbtab != 0);
|
||||
|
||||
@ -7498,10 +7507,13 @@ ndb_get_table_statistics(Ndb* ndb, const NDBTAB *ndbtab,
|
||||
ndbstat->row_size= sum_row_size;
|
||||
ndbstat->fragment_memory= sum_mem;
|
||||
|
||||
DBUG_PRINT("exit", ("records: %llu commits: %llu "
|
||||
"row_size: %llu mem: %llu count: %u",
|
||||
sum_rows, sum_commits, sum_row_size,
|
||||
sum_mem, count));
|
||||
DBUG_PRINT("exit", ("records: %s commits: %s "
|
||||
"row_size: %s mem: %s count: %u",
|
||||
llstr(sum_rows, buff),
|
||||
llstr(sum_commits, buff2),
|
||||
llstr(sum_row_size, buff3),
|
||||
llstr(sum_mem, buff4),
|
||||
count));
|
||||
|
||||
DBUG_RETURN(0);
|
||||
retry:
|
||||
@ -8153,9 +8165,12 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
if (ndbtab_g.get_table() &&
|
||||
ndb_get_table_statistics(ndb, ndbtab_g.get_table(), &stat) == 0)
|
||||
{
|
||||
char buff[22], buff2[22];
|
||||
DBUG_PRINT("ndb_util_thread",
|
||||
("Table: %s, commit_count: %llu, rows: %llu",
|
||||
share->key, stat.commit_count, stat.row_count));
|
||||
share->key,
|
||||
llstr(stat.commit_count, buff),
|
||||
llstr(stat.row_count, buff)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
44
sql/item.cc
44
sql/item.cc
@ -1343,35 +1343,37 @@ void my_coll_agg_error(DTCollation &c1, DTCollation &c2, DTCollation &c3,
|
||||
|
||||
|
||||
static
|
||||
void my_coll_agg_error(Item** args, uint count, const char *fname)
|
||||
void my_coll_agg_error(Item** args, uint count, const char *fname,
|
||||
int item_sep)
|
||||
{
|
||||
if (count == 2)
|
||||
my_coll_agg_error(args[0]->collation, args[1]->collation, fname);
|
||||
my_coll_agg_error(args[0]->collation, args[item_sep]->collation, fname);
|
||||
else if (count == 3)
|
||||
my_coll_agg_error(args[0]->collation, args[1]->collation,
|
||||
args[2]->collation, fname);
|
||||
my_coll_agg_error(args[0]->collation, args[item_sep]->collation,
|
||||
args[2*item_sep]->collation, fname);
|
||||
else
|
||||
my_error(ER_CANT_AGGREGATE_NCOLLATIONS,MYF(0),fname);
|
||||
}
|
||||
|
||||
|
||||
bool agg_item_collations(DTCollation &c, const char *fname,
|
||||
Item **av, uint count, uint flags)
|
||||
Item **av, uint count, uint flags, int item_sep)
|
||||
{
|
||||
uint i;
|
||||
Item **arg;
|
||||
c.set(av[0]->collation);
|
||||
for (i= 1; i < count; i++)
|
||||
for (i= 1, arg= &av[item_sep]; i < count; i++, arg++)
|
||||
{
|
||||
if (c.aggregate(av[i]->collation, flags))
|
||||
if (c.aggregate((*arg)->collation, flags))
|
||||
{
|
||||
my_coll_agg_error(av, count, fname);
|
||||
my_coll_agg_error(av, count, fname, item_sep);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if ((flags & MY_COLL_DISALLOW_NONE) &&
|
||||
c.derivation == DERIVATION_NONE)
|
||||
{
|
||||
my_coll_agg_error(av, count, fname);
|
||||
my_coll_agg_error(av, count, fname, item_sep);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@ -1382,7 +1384,7 @@ bool agg_item_collations_for_comparison(DTCollation &c, const char *fname,
|
||||
Item **av, uint count, uint flags)
|
||||
{
|
||||
return (agg_item_collations(c, fname, av, count,
|
||||
flags | MY_COLL_DISALLOW_NONE));
|
||||
flags | MY_COLL_DISALLOW_NONE, 1));
|
||||
}
|
||||
|
||||
|
||||
@ -1405,15 +1407,26 @@ bool agg_item_collations_for_comparison(DTCollation &c, const char *fname,
|
||||
For functions with more than two arguments:
|
||||
|
||||
collect(A,B,C) ::= collect(collect(A,B),C)
|
||||
|
||||
Since this function calls THD::change_item_tree() on the passed Item **
|
||||
pointers, it is necessary to pass the original Item **'s, not copies.
|
||||
Otherwise their values will not be properly restored (see BUG#20769).
|
||||
If the items are not consecutive (eg. args[2] and args[5]), use the
|
||||
item_sep argument, ie.
|
||||
|
||||
agg_item_charsets(coll, fname, &args[2], 2, flags, 3)
|
||||
|
||||
*/
|
||||
|
||||
bool agg_item_charsets(DTCollation &coll, const char *fname,
|
||||
Item **args, uint nargs, uint flags)
|
||||
Item **args, uint nargs, uint flags, int item_sep)
|
||||
{
|
||||
Item **arg, **last, *safe_args[2];
|
||||
|
||||
LINT_INIT(safe_args[0]);
|
||||
LINT_INIT(safe_args[1]);
|
||||
|
||||
if (agg_item_collations(coll, fname, args, nargs, flags, item_sep))
|
||||
if (agg_item_collations(coll, fname, args, nargs, flags))
|
||||
return TRUE;
|
||||
|
||||
@ -1427,19 +1440,20 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
|
||||
if (nargs >=2 && nargs <= 3)
|
||||
{
|
||||
safe_args[0]= args[0];
|
||||
safe_args[1]= args[1];
|
||||
safe_args[1]= args[item_sep];
|
||||
}
|
||||
|
||||
THD *thd= current_thd;
|
||||
Query_arena *arena, backup;
|
||||
bool res= FALSE;
|
||||
uint i;
|
||||
/*
|
||||
In case we're in statement prepare, create conversion item
|
||||
in its memory: it will be reused on each execute.
|
||||
*/
|
||||
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||
|
||||
for (arg= args, last= args + nargs; arg < last; arg++)
|
||||
for (i= 0, arg= args; i < nargs; i++, arg+= item_sep)
|
||||
{
|
||||
Item* conv;
|
||||
uint32 dummy_offset;
|
||||
@ -1454,9 +1468,9 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
|
||||
{
|
||||
/* restore the original arguments for better error message */
|
||||
args[0]= safe_args[0];
|
||||
args[1]= safe_args[1];
|
||||
args[item_sep]= safe_args[1];
|
||||
}
|
||||
my_coll_agg_error(args, nargs, fname);
|
||||
my_coll_agg_error(args, nargs, fname, item_sep);
|
||||
res= TRUE;
|
||||
break; // we cannot return here, we need to restore "arena".
|
||||
}
|
||||
|
@ -1139,12 +1139,11 @@ public:
|
||||
};
|
||||
|
||||
bool agg_item_collations(DTCollation &c, const char *name,
|
||||
Item **items, uint nitems, uint flags= 0);
|
||||
Item **items, uint nitems, uint flags, int item_sep);
|
||||
bool agg_item_collations_for_comparison(DTCollation &c, const char *name,
|
||||
Item **items, uint nitems,
|
||||
uint flags= 0);
|
||||
Item **items, uint nitems, uint flags);
|
||||
bool agg_item_charsets(DTCollation &c, const char *name,
|
||||
Item **items, uint nitems, uint flags= 0);
|
||||
Item **items, uint nitems, uint flags, int item_sep);
|
||||
|
||||
|
||||
class Item_num: public Item
|
||||
|
@ -409,7 +409,7 @@ void Item_bool_func2::fix_length_and_dec()
|
||||
DTCollation coll;
|
||||
if (args[0]->result_type() == STRING_RESULT &&
|
||||
args[1]->result_type() == STRING_RESULT &&
|
||||
agg_arg_charsets(coll, args, 2, MY_COLL_CMP_CONV))
|
||||
agg_arg_charsets(coll, args, 2, MY_COLL_CMP_CONV, 1))
|
||||
return;
|
||||
|
||||
|
||||
@ -1226,7 +1226,7 @@ void Item_func_between::fix_length_and_dec()
|
||||
agg_cmp_type(thd, &cmp_type, args, 3);
|
||||
|
||||
if (cmp_type == STRING_RESULT)
|
||||
agg_arg_charsets(cmp_collation, args, 3, MY_COLL_CMP_CONV);
|
||||
agg_arg_charsets(cmp_collation, args, 3, MY_COLL_CMP_CONV, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1346,7 +1346,7 @@ Item_func_ifnull::fix_length_and_dec()
|
||||
|
||||
switch (hybrid_type) {
|
||||
case STRING_RESULT:
|
||||
agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV);
|
||||
agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV, 1);
|
||||
break;
|
||||
case DECIMAL_RESULT:
|
||||
case REAL_RESULT:
|
||||
@ -1518,7 +1518,7 @@ Item_func_if::fix_length_and_dec()
|
||||
agg_result_type(&cached_result_type, args+1, 2);
|
||||
if (cached_result_type == STRING_RESULT)
|
||||
{
|
||||
if (agg_arg_charsets(collation, args+1, 2, MY_COLL_ALLOW_CONV))
|
||||
if (agg_arg_charsets(collation, args+1, 2, MY_COLL_ALLOW_CONV, 1))
|
||||
return;
|
||||
}
|
||||
else
|
||||
@ -1599,7 +1599,7 @@ Item_func_nullif::fix_length_and_dec()
|
||||
unsigned_flag= args[0]->unsigned_flag;
|
||||
cached_result_type= args[0]->result_type();
|
||||
if (cached_result_type == STRING_RESULT &&
|
||||
agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV))
|
||||
agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV, 1))
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1891,7 +1891,7 @@ void Item_func_case::fix_length_and_dec()
|
||||
|
||||
agg_result_type(&cached_result_type, agg, nagg);
|
||||
if ((cached_result_type == STRING_RESULT) &&
|
||||
agg_arg_charsets(collation, agg, nagg, MY_COLL_ALLOW_CONV))
|
||||
agg_arg_charsets(collation, agg, nagg, MY_COLL_ALLOW_CONV, 1))
|
||||
return;
|
||||
|
||||
|
||||
@ -1907,7 +1907,7 @@ void Item_func_case::fix_length_and_dec()
|
||||
nagg++;
|
||||
agg_cmp_type(thd, &cmp_type, agg, nagg);
|
||||
if ((cmp_type == STRING_RESULT) &&
|
||||
agg_arg_charsets(cmp_collation, agg, nagg, MY_COLL_CMP_CONV))
|
||||
agg_arg_charsets(cmp_collation, agg, nagg, MY_COLL_CMP_CONV, 1))
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2037,7 +2037,7 @@ void Item_func_coalesce::fix_length_and_dec()
|
||||
case STRING_RESULT:
|
||||
count_only_length();
|
||||
decimals= NOT_FIXED_DEC;
|
||||
agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV);
|
||||
agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV, 1);
|
||||
break;
|
||||
case DECIMAL_RESULT:
|
||||
count_decimal_length();
|
||||
@ -2501,7 +2501,7 @@ void Item_func_in::fix_length_and_dec()
|
||||
agg_cmp_type(thd, &cmp_type, args, arg_count);
|
||||
|
||||
if (cmp_type == STRING_RESULT &&
|
||||
agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV))
|
||||
agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV, 1))
|
||||
return;
|
||||
|
||||
for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++)
|
||||
@ -3234,7 +3234,7 @@ Item_func_regex::fix_fields(THD *thd, Item **ref)
|
||||
max_length= 1;
|
||||
decimals= 0;
|
||||
|
||||
if (agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV))
|
||||
if (agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV, 1))
|
||||
return TRUE;
|
||||
|
||||
used_tables_cache=args[0]->used_tables() | args[1]->used_tables();
|
||||
|
@ -2036,7 +2036,7 @@ void Item_func_min_max::fix_length_and_dec()
|
||||
cmp_type=item_cmp_type(cmp_type,args[i]->result_type());
|
||||
}
|
||||
if (cmp_type == STRING_RESULT)
|
||||
agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV);
|
||||
agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV, 1);
|
||||
else if ((cmp_type == DECIMAL_RESULT) || (cmp_type == INT_RESULT))
|
||||
max_length= my_decimal_precision_to_length(max_int_part+decimals, decimals,
|
||||
unsigned_flag);
|
||||
@ -2222,7 +2222,7 @@ longlong Item_func_coercibility::val_int()
|
||||
void Item_func_locate::fix_length_and_dec()
|
||||
{
|
||||
maybe_null=0; max_length=11;
|
||||
agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV);
|
||||
agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -2339,7 +2339,7 @@ void Item_func_field::fix_length_and_dec()
|
||||
for (uint i=1; i < arg_count ; i++)
|
||||
cmp_type= item_cmp_type(cmp_type, args[i]->result_type());
|
||||
if (cmp_type == STRING_RESULT)
|
||||
agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV);
|
||||
agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -2406,7 +2406,7 @@ void Item_func_find_in_set::fix_length_and_dec()
|
||||
}
|
||||
}
|
||||
}
|
||||
agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV);
|
||||
agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV, 1);
|
||||
}
|
||||
|
||||
static const char separator=',';
|
||||
@ -4401,7 +4401,8 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
|
||||
return 1;
|
||||
}
|
||||
table->fulltext_searched=1;
|
||||
return agg_arg_collations_for_comparison(cmp_collation, args+1, arg_count-1);
|
||||
return agg_arg_collations_for_comparison(cmp_collation,
|
||||
args+1, arg_count-1, 0);
|
||||
}
|
||||
|
||||
bool Item_func_match::fix_index()
|
||||
|
@ -166,21 +166,21 @@ public:
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
|
||||
bool agg_arg_collations(DTCollation &c, Item **items, uint nitems,
|
||||
uint flags= 0)
|
||||
uint flags)
|
||||
{
|
||||
return agg_item_collations(c, func_name(), items, nitems, flags);
|
||||
return agg_item_collations(c, func_name(), items, nitems, flags, 1);
|
||||
}
|
||||
bool agg_arg_collations_for_comparison(DTCollation &c,
|
||||
Item **items, uint nitems,
|
||||
uint flags= 0)
|
||||
uint flags)
|
||||
{
|
||||
return agg_item_collations_for_comparison(c, func_name(),
|
||||
items, nitems, flags);
|
||||
}
|
||||
bool agg_arg_charsets(DTCollation &c, Item **items, uint nitems,
|
||||
uint flags= 0)
|
||||
uint flags, int item_sep)
|
||||
{
|
||||
return agg_item_charsets(c, func_name(), items, nitems, flags);
|
||||
return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep);
|
||||
}
|
||||
bool walk(Item_processor processor, bool walk_subquery, byte *arg);
|
||||
Item *transform(Item_transformer transformer, byte *arg);
|
||||
|
@ -405,7 +405,7 @@ void Item_func_concat::fix_length_and_dec()
|
||||
{
|
||||
ulonglong max_result_length= 0;
|
||||
|
||||
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV))
|
||||
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV, 1))
|
||||
return;
|
||||
|
||||
for (uint i=0 ; i < arg_count ; i++)
|
||||
@ -727,7 +727,7 @@ void Item_func_concat_ws::fix_length_and_dec()
|
||||
{
|
||||
ulonglong max_result_length;
|
||||
|
||||
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV))
|
||||
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV, 1))
|
||||
return;
|
||||
|
||||
/*
|
||||
@ -937,7 +937,7 @@ void Item_func_replace::fix_length_and_dec()
|
||||
}
|
||||
max_length= (ulong) max_result_length;
|
||||
|
||||
if (agg_arg_charsets(collation, args, 3, MY_COLL_CMP_CONV))
|
||||
if (agg_arg_charsets(collation, args, 3, MY_COLL_CMP_CONV, 1))
|
||||
return;
|
||||
}
|
||||
|
||||
@ -982,15 +982,11 @@ null:
|
||||
|
||||
void Item_func_insert::fix_length_and_dec()
|
||||
{
|
||||
Item *cargs[2];
|
||||
ulonglong max_result_length;
|
||||
|
||||
cargs[0]= args[0];
|
||||
cargs[1]= args[3];
|
||||
if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV))
|
||||
// Handle character set for args[0] and args[3].
|
||||
if (agg_arg_charsets(collation, &args[0], 2, MY_COLL_ALLOW_CONV, 3))
|
||||
return;
|
||||
args[0]= cargs[0];
|
||||
args[3]= cargs[1];
|
||||
max_result_length= ((ulonglong) args[0]->max_length+
|
||||
(ulonglong) args[3]->max_length);
|
||||
if (max_result_length >= MAX_BLOB_WIDTH)
|
||||
@ -1161,7 +1157,7 @@ void Item_func_substr_index::fix_length_and_dec()
|
||||
{
|
||||
max_length= args[0]->max_length;
|
||||
|
||||
if (agg_arg_charsets(collation, args, 2, MY_COLL_CMP_CONV))
|
||||
if (agg_arg_charsets(collation, args, 2, MY_COLL_CMP_CONV, 1))
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1497,13 +1493,10 @@ void Item_func_trim::fix_length_and_dec()
|
||||
}
|
||||
else
|
||||
{
|
||||
Item *cargs[2];
|
||||
cargs[0]= args[1];
|
||||
cargs[1]= args[0];
|
||||
if (agg_arg_charsets(collation, cargs, 2, MY_COLL_CMP_CONV))
|
||||
// Handle character set for args[1] and args[0].
|
||||
// Note that we pass args[1] as the first item, and args[0] as the second.
|
||||
if (agg_arg_charsets(collation, &args[1], 2, MY_COLL_CMP_CONV, -1))
|
||||
return;
|
||||
args[0]= cargs[1];
|
||||
args[1]= cargs[0];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1887,7 +1880,7 @@ void Item_func_elt::fix_length_and_dec()
|
||||
max_length=0;
|
||||
decimals=0;
|
||||
|
||||
if (agg_arg_charsets(collation, args+1, arg_count-1, MY_COLL_ALLOW_CONV))
|
||||
if (agg_arg_charsets(collation, args+1, arg_count-1, MY_COLL_ALLOW_CONV, 1))
|
||||
return;
|
||||
|
||||
for (uint i= 1 ; i < arg_count ; i++)
|
||||
@ -1954,7 +1947,7 @@ void Item_func_make_set::fix_length_and_dec()
|
||||
{
|
||||
max_length=arg_count-1;
|
||||
|
||||
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV))
|
||||
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV, 1))
|
||||
return;
|
||||
|
||||
for (uint i=0 ; i < arg_count ; i++)
|
||||
@ -2162,14 +2155,9 @@ err:
|
||||
|
||||
void Item_func_rpad::fix_length_and_dec()
|
||||
{
|
||||
Item *cargs[2];
|
||||
|
||||
cargs[0]= args[0];
|
||||
cargs[1]= args[2];
|
||||
if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV))
|
||||
// Handle character set for args[0] and args[2].
|
||||
if (agg_arg_charsets(collation, &args[0], 2, MY_COLL_ALLOW_CONV, 2))
|
||||
return;
|
||||
args[0]= cargs[0];
|
||||
args[2]= cargs[1];
|
||||
if (args[1]->const_item())
|
||||
{
|
||||
ulonglong length= ((ulonglong) args[1]->val_int() *
|
||||
@ -2249,13 +2237,9 @@ String *Item_func_rpad::val_str(String *str)
|
||||
|
||||
void Item_func_lpad::fix_length_and_dec()
|
||||
{
|
||||
Item *cargs[2];
|
||||
cargs[0]= args[0];
|
||||
cargs[1]= args[2];
|
||||
if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV))
|
||||
// Handle character set for args[0] and args[2].
|
||||
if (agg_arg_charsets(collation, &args[0], 2, MY_COLL_ALLOW_CONV, 2))
|
||||
return;
|
||||
args[0]= cargs[0];
|
||||
args[2]= cargs[1];
|
||||
|
||||
if (args[1]->const_item())
|
||||
{
|
||||
@ -2712,8 +2696,8 @@ void Item_func_export_set::fix_length_and_dec()
|
||||
uint sep_length=(arg_count > 3 ? args[3]->max_length : 1);
|
||||
max_length=length*64+sep_length*63;
|
||||
|
||||
if (agg_arg_charsets(collation, args+1, min(4,arg_count)-1),
|
||||
MY_COLL_ALLOW_CONV)
|
||||
if (agg_arg_charsets(collation, args+1, min(4,arg_count)-1,
|
||||
MY_COLL_ALLOW_CONV, 1))
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3248,7 +3248,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
|
||||
args,
|
||||
/* skip charset aggregation for order columns */
|
||||
arg_count - arg_count_order,
|
||||
MY_COLL_ALLOW_CONV))
|
||||
MY_COLL_ALLOW_CONV, 1))
|
||||
return 1;
|
||||
|
||||
result.set_charset(collation.collation);
|
||||
|
@ -44,6 +44,7 @@ int main(int argc, char **argv)
|
||||
get_options(argc,argv);
|
||||
|
||||
bzero(&hp_create_info, sizeof(hp_create_info));
|
||||
hp_create_info.max_table_size= 1024L*1024L;
|
||||
|
||||
keyinfo[0].keysegs=1;
|
||||
keyinfo[0].seg=keyseg;
|
||||
@ -58,7 +59,7 @@ int main(int argc, char **argv)
|
||||
bzero((gptr) flags,sizeof(flags));
|
||||
|
||||
printf("- Creating heap-file\n");
|
||||
if (heap_create(filename,1,keyinfo,30,(ulong) flag*100000l,10l,
|
||||
if (heap_create(filename,1,keyinfo,30,(ulong) flag*100000L,10L,
|
||||
&hp_create_info) ||
|
||||
!(file= heap_open(filename, 2)))
|
||||
goto err;
|
||||
|
@ -26,7 +26,8 @@
|
||||
|
||||
*/
|
||||
|
||||
#include "my_base.h" /* Includes errno.h */
|
||||
#include "my_base.h" /* Defines EOVERFLOW on Windows */
|
||||
#include "my_global.h" /* Includes errno.h */
|
||||
#include "m_ctype.h"
|
||||
|
||||
#define MAX_DBL_EXP 308
|
||||
|
@ -28,6 +28,23 @@
|
||||
|
||||
%define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
|
||||
|
||||
# On SuSE 9 no separate "debuginfo" package is built. To enable basic
|
||||
# debugging on that platform, we don't strip binaries on SuSE 9. We
|
||||
# disable the strip of binaries by redefining the RPM macro
|
||||
# "__os_install_post" leaving out the script calls that normally does
|
||||
# this. We do this in all cases, as on platforms where "debuginfo" is
|
||||
# created, a script "find-debuginfo.sh" will be called that will do
|
||||
# the strip anyway, part of separating the executable and debug
|
||||
# information into separate files put into separate packages.
|
||||
#
|
||||
# Some references (shows more advanced conditional usage):
|
||||
# http://www.redhat.com/archives/rpm-list/2001-November/msg00257.html
|
||||
# http://www.redhat.com/archives/rpm-list/2003-February/msg00275.html
|
||||
# http://www.redhat.com/archives/rhl-devel-list/2004-January/msg01546.html
|
||||
# http://lists.opensuse.org/archive/opensuse-commit/2006-May/1171.html
|
||||
|
||||
%define __os_install_post /usr/lib/rpm/brp-compress
|
||||
|
||||
Name: MySQL
|
||||
Summary: MySQL: a very fast and reliable SQL database server
|
||||
Group: Applications/Databases
|
||||
|
@ -14900,11 +14900,13 @@ static void test_bug17667()
|
||||
|
||||
printf("success. All queries found intact in the log.\n");
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Could not find the log file, var/log/master.log, so "
|
||||
"test_bug17667 is \ninconclusive. Run test from the "
|
||||
"mysql-test/mysql-test-run* program \nto set up the correct "
|
||||
"environment for this test.\n\n");
|
||||
"test_bug17667 is \ninconclusive. Run test from the "
|
||||
"mysql-test/mysql-test-run* program \nto set up the correct "
|
||||
"environment for this test.\n\n");
|
||||
}
|
||||
|
||||
if (log_file != NULL)
|
||||
@ -14914,7 +14916,8 @@ static void test_bug17667()
|
||||
|
||||
|
||||
/*
|
||||
Bug#14169: type of group_concat() result changed to blob if tmp_table was used
|
||||
Bug#14169: type of group_concat() result changed to blob if tmp_table was
|
||||
used
|
||||
*/
|
||||
static void test_bug14169()
|
||||
{
|
||||
@ -14949,10 +14952,10 @@ static void test_bug14169()
|
||||
myquery(rc);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Test that mysql_insert_id() behaves as documented in our manual
|
||||
*/
|
||||
|
||||
static void test_mysql_insert_id()
|
||||
{
|
||||
my_ulonglong res;
|
||||
@ -15133,6 +15136,56 @@ static void test_mysql_insert_id()
|
||||
myquery(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
Bug#20152: mysql_stmt_execute() writes to MYSQL_TYPE_DATE buffer
|
||||
*/
|
||||
|
||||
static void test_bug20152()
|
||||
{
|
||||
MYSQL_BIND bind[1];
|
||||
MYSQL_STMT *stmt;
|
||||
MYSQL_TIME tm;
|
||||
int rc;
|
||||
const char *query= "INSERT INTO t1 (f1) VALUES (?)";
|
||||
|
||||
myheader("test_bug20152");
|
||||
|
||||
memset(bind, 0, sizeof(bind));
|
||||
bind[0].buffer_type= MYSQL_TYPE_DATE;
|
||||
bind[0].buffer= (void*)&tm;
|
||||
|
||||
tm.year = 2006;
|
||||
tm.month = 6;
|
||||
tm.day = 18;
|
||||
tm.hour = 14;
|
||||
tm.minute = 9;
|
||||
tm.second = 42;
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
||||
myquery(rc);
|
||||
rc= mysql_query(mysql, "CREATE TABLE t1 (f1 DATE)");
|
||||
myquery(rc);
|
||||
|
||||
stmt= mysql_stmt_init(mysql);
|
||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
||||
check_execute(stmt, rc);
|
||||
rc= mysql_stmt_bind_param(stmt, bind);
|
||||
check_execute(stmt, rc);
|
||||
rc= mysql_stmt_execute(stmt);
|
||||
check_execute(stmt, rc);
|
||||
rc= mysql_stmt_close(stmt);
|
||||
check_execute(stmt, rc);
|
||||
rc= mysql_query(mysql, "DROP TABLE t1");
|
||||
myquery(rc);
|
||||
|
||||
if (tm.hour == 14 && tm.minute == 9 && tm.second == 42) {
|
||||
if (!opt_silent)
|
||||
printf("OK!");
|
||||
} else {
|
||||
printf("[14:09:42] != [%02d:%02d:%02d]\n", tm.hour, tm.minute, tm.second);
|
||||
DIE_UNLESS(0==1);
|
||||
}
|
||||
}
|
||||
/*
|
||||
Read and parse arguments and MySQL options from my.cnf
|
||||
*/
|
||||
@ -15398,6 +15451,7 @@ static struct my_tests_st my_tests[]= {
|
||||
{ "test_bug16143", test_bug16143 },
|
||||
{ "test_bug16144", test_bug16144 },
|
||||
{ "test_bug15613", test_bug15613 },
|
||||
{ "test_bug20152", test_bug20152 },
|
||||
{ "test_bug14169", test_bug14169 },
|
||||
{ "test_bug17667", test_bug17667 },
|
||||
{ "test_mysql_insert_id", test_mysql_insert_id },
|
||||
|
Loading…
x
Reference in New Issue
Block a user