summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-02-17 11:00:51 +0100
committerSergei Golubchik <sergii@pisem.net>2014-02-17 11:00:51 +0100
commit84651126c0f101ea762eec0eb4045f533a00e96d (patch)
tree1bba1d0079b08cb10fe69e03942cd5f254dc735e /sql
parent1fa5183241e5a8e8e91690f0c35d676e9f3334ca (diff)
parentf7c8dd6bc7bb6d46d1ae2b6fdb47227429387e33 (diff)
downloadmariadb-git-84651126c0f101ea762eec0eb4045f533a00e96d.tar.gz
MySQL-5.5.36 merge
(without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
Diffstat (limited to 'sql')
-rw-r--r--sql/CMakeLists.txt2
-rw-r--r--sql/custom_conf.h3
-rw-r--r--sql/event_scheduler.cc2
-rw-r--r--sql/event_scheduler.h2
-rw-r--r--sql/events.cc2
-rw-r--r--sql/events.h2
-rw-r--r--sql/field.h16
-rw-r--r--sql/filesort.cc46
-rw-r--r--sql/ha_ndbcluster_cond.cc2
-rw-r--r--sql/ha_ndbcluster_cond.h2
-rw-r--r--sql/ha_ndbcluster_tables.h3
-rw-r--r--sql/ha_partition.cc35
-rw-r--r--sql/hostname.cc4
-rw-r--r--sql/item_cmpfunc.h2
-rw-r--r--sql/item_func.h4
-rw-r--r--sql/item_strfunc.cc28
-rw-r--r--sql/item_sum.cc69
-rw-r--r--sql/item_sum.h43
-rw-r--r--sql/item_xmlfunc.cc5
-rw-r--r--sql/key.cc2
-rw-r--r--sql/key.h2
-rw-r--r--sql/lex_symbol.h3
-rw-r--r--sql/log.cc4
-rw-r--r--sql/log_event.cc20
-rw-r--r--sql/log_event.h9
-rw-r--r--sql/log_event_old.h9
-rw-r--r--sql/mem_root_array.h2
-rw-r--r--sql/my_decimal.h4
-rw-r--r--sql/mysqld.cc6
-rw-r--r--sql/mysqld.h2
-rw-r--r--sql/partition_element.h2
-rw-r--r--sql/partition_info.h2
-rw-r--r--sql/rpl_filter.cc2
-rw-r--r--sql/rpl_record.cc23
-rw-r--r--sql/rpl_record.h11
-rw-r--r--sql/rpl_utility.cc19
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/set_var.h1
-rw-r--r--sql/share/charsets/Index.xml2
-rw-r--r--sql/share/charsets/armscii8.xml3
-rw-r--r--sql/share/charsets/ascii.xml2
-rw-r--r--sql/share/charsets/cp1250.xml2
-rw-r--r--sql/share/charsets/cp852.xml3
-rw-r--r--sql/share/charsets/hebrew.xml2
-rw-r--r--sql/share/charsets/latin1.xml2
-rw-r--r--sql/share/charsets/latin2.xml2
-rw-r--r--sql/share/charsets/latin5.xml2
-rw-r--r--sql/signal_handler.cc4
-rw-r--r--sql/slave.cc4
-rw-r--r--sql/sql_acl.cc4
-rw-r--r--sql/sql_admin.h2
-rw-r--r--sql/sql_analyse.cc2
-rw-r--r--sql/sql_audit.cc2
-rw-r--r--sql/sql_audit.h2
-rw-r--r--sql/sql_binlog.cc2
-rw-r--r--sql/sql_bitmap.h2
-rw-r--r--sql/sql_connect.cc4
-rw-r--r--sql/sql_help.cc3
-rw-r--r--sql/sql_manager.cc2
-rw-r--r--sql/sql_partition_admin.cc2
-rw-r--r--sql/sql_plugin.cc4
-rw-r--r--sql/sql_repl.cc2
-rw-r--r--sql/sql_string.cc3
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_view.cc4
-rw-r--r--sql/strfunc.cc2
-rw-r--r--sql/table.cc5
-rw-r--r--sql/table.h4
-rw-r--r--sql/transaction.h3
69 files changed, 276 insertions, 205 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 6483ba01d2a..709306e8073 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2011, Oracle and/or its affiliates.
+# Copyright (c) 2006, 2013, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/sql/custom_conf.h b/sql/custom_conf.h
index afef0219857..62fdb619c27 100644
--- a/sql/custom_conf.h
+++ b/sql/custom_conf.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2006 MySQL AB
+ Use is subject to license terms
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 95152778bfd..f8d177ac0c1 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h
index 9435ee548d9..538514b8b12 100644
--- a/sql/event_scheduler.h
+++ b/sql/event_scheduler.h
@@ -1,6 +1,6 @@
#ifndef _EVENT_SCHEDULER_H_
#define _EVENT_SCHEDULER_H_
-/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/events.cc b/sql/events.cc
index bbeeaf65eb2..763c75e77b0 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2005, 2013, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/events.h b/sql/events.h
index d6fc4b5ea67..223f68c8370 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -1,6 +1,6 @@
#ifndef _EVENT_H_
#define _EVENT_H_
-/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/field.h b/sql/field.h
index 3544444bf43..10b854001cd 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1,7 +1,7 @@
#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2008, 2011, Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1869,18 +1869,6 @@ public:
{
store_length(ptr, packlength, number);
}
-
- /**
- Return the packed length plus the length of the data.
-
- This is used to determine the size of the data plus the
- packed length portion in the row data.
-
- @returns The length in the row plus the size of the data.
- */
- uint32 get_packed_size(const uchar *ptr_arg)
- {return packlength + get_length(ptr_arg, packlength);}
-
inline uint32 get_length(uint row_offset= 0)
{ return get_length(ptr+row_offset, this->packlength); }
uint32 get_length(const uchar *ptr, uint packlength);
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 7b019022409..0c91e42d426 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -36,6 +36,7 @@
#include "opt_range.h" // SQL_SELECT
#include "log_slow.h"
#include "debug_sync.h"
+#include "sql_base.h"
/// How to write record_ref.
#define WRITE_REF(file,from) \
@@ -332,6 +333,14 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
{
int kill_errno= thd->killed_errno();
DBUG_ASSERT(thd->is_error() || kill_errno || thd->killed == ABORT_QUERY);
+
+ /*
+ We replace the table->sort at the end.
+ Hence calling free_io_cache to make sure table->sort.io_cache
+ used for QUICK_INDEX_MERGE_SELECT is free.
+ */
+ free_io_cache(table);
+
my_printf_error(ER_FILSORT_ABORT,
"%s: %s",
MYF(0),
@@ -356,6 +365,10 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
#ifdef SKIP_DBUG_IN_FILESORT
DBUG_POP(); /* Ok to DBUG */
#endif
+
+ /* table->sort.io_cache should be free by this time */
+ DBUG_ASSERT(NULL == table->sort.io_cache);
+
memcpy(&table->sort, &table_sort, sizeof(FILESORT_INFO));
DBUG_PRINT("exit",("num_rows: %ld", (long) num_rows));
MYSQL_FILESORT_DONE(error, num_rows);
@@ -565,6 +578,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
DBUG_RETURN(HA_POS_ERROR);
}
+ DEBUG_SYNC(thd, "after_index_merge_phase1");
for (;;)
{
if (quick_select)
@@ -807,8 +821,6 @@ static void make_sortkey(register SORTPARAM *param,
{
CHARSET_INFO *cs=item->collation.collation;
char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' ');
- int diff;
- uint sort_field_length;
if (maybe_null)
*to++=1;
@@ -836,25 +848,13 @@ static void make_sortkey(register SORTPARAM *param,
break;
}
length= res->length();
- sort_field_length= sort_field->length - sort_field->suffix_length;
- diff=(int) (sort_field_length - length);
- if (diff < 0)
- {
- diff=0;
- length= sort_field_length;
- }
- if (sort_field->suffix_length)
- {
- /* Store length last in result_string */
- store_length(to + sort_field_length, length,
- sort_field->suffix_length);
- }
if (sort_field->need_strxnfrm)
{
char *from=(char*) res->ptr();
uint tmp_length __attribute__((unused));
if ((uchar*) from == to)
{
+ DBUG_ASSERT(sort_field->length >= length);
set_if_smaller(length,sort_field->length);
memcpy(param->tmp_buffer,from,length);
from=param->tmp_buffer;
@@ -865,6 +865,22 @@ static void make_sortkey(register SORTPARAM *param,
}
else
{
+ uint diff;
+ uint sort_field_length= sort_field->length -
+ sort_field->suffix_length;
+ if (sort_field_length < length)
+ {
+ diff= 0;
+ length= sort_field_length;
+ }
+ else
+ diff= sort_field_length - length;
+ if (sort_field->suffix_length)
+ {
+ /* Store length last in result_string */
+ store_length(to + sort_field_length, length,
+ sort_field->suffix_length);
+ }
my_strnxfrm(cs,(uchar*)to,length,(const uchar*)res->ptr(),length);
cs->cset->fill(cs, (char *)to+length,diff,fill_char);
}
diff --git a/sql/ha_ndbcluster_cond.cc b/sql/ha_ndbcluster_cond.cc
index f8b2ed8429a..e1bd6271866 100644
--- a/sql/ha_ndbcluster_cond.cc
+++ b/sql/ha_ndbcluster_cond.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/ha_ndbcluster_cond.h b/sql/ha_ndbcluster_cond.h
index 27675588ed7..2387dcaf5ba 100644
--- a/sql/ha_ndbcluster_cond.h
+++ b/sql/ha_ndbcluster_cond.h
@@ -1,7 +1,7 @@
#ifndef HA_NDBCLUSTER_COND_INCLUDED
#define HA_NDBCLUSTER_COND_INCLUDED
-/* Copyright (C) 2000-2007 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/ha_ndbcluster_tables.h b/sql/ha_ndbcluster_tables.h
index 6ed46123738..4d97ca2c254 100644
--- a/sql/ha_ndbcluster_tables.h
+++ b/sql/ha_ndbcluster_tables.h
@@ -1,7 +1,8 @@
#ifndef HA_NDBCLUSTER_TABLES_INCLUDED
#define HA_NDBCLUSTER_TABLES_INCLUDED
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000-2003, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 84a48cfed07..87e80bd49cb 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -5564,7 +5564,7 @@ void ha_partition::return_top_record(uchar *buf)
int ha_partition::handle_ordered_index_scan_key_not_found()
{
int error;
- uint i;
+ uint i, old_elements= m_queue.elements;
uchar *part_buf= m_ordered_rec_buffer;
uchar *curr_rec_buf= NULL;
DBUG_ENTER("ha_partition::handle_ordered_index_scan_key_not_found");
@@ -5599,9 +5599,12 @@ int ha_partition::handle_ordered_index_scan_key_not_found()
bitmap_clear_all(&m_key_not_found_partitions);
m_key_not_found= false;
- /* Update m_top_entry, which may have changed. */
- uchar *key_buffer= queue_top(&m_queue);
- m_top_entry= uint2korr(key_buffer);
+ if (m_queue.elements > old_elements)
+ {
+ /* Update m_top_entry, which may have changed. */
+ uchar *key_buffer= queue_top(&m_queue);
+ m_top_entry= uint2korr(key_buffer);
+ }
DBUG_RETURN(0);
}
@@ -7651,19 +7654,29 @@ uint ha_partition::min_record_length(uint options) const
int ha_partition::cmp_ref(const uchar *ref1, const uchar *ref2)
{
- uint part_id;
+ int cmp;
my_ptrdiff_t diff1, diff2;
- handler *file;
DBUG_ENTER("ha_partition::cmp_ref");
+ cmp = m_file[0]->cmp_ref((ref1 + PARTITION_BYTES_IN_POS),
+ (ref2 + PARTITION_BYTES_IN_POS));
+ if (cmp)
+ DBUG_RETURN(cmp);
+
if ((ref1[0] == ref2[0]) && (ref1[1] == ref2[1]))
{
- part_id= uint2korr(ref1);
- file= m_file[part_id];
- DBUG_ASSERT(part_id < m_tot_parts);
- DBUG_RETURN(file->cmp_ref((ref1 + PARTITION_BYTES_IN_POS),
- (ref2 + PARTITION_BYTES_IN_POS)));
+ /* This means that the references are same and are in same partition.*/
+ DBUG_RETURN(0);
}
+
+ /*
+ In Innodb we compare with either primary key value or global DB_ROW_ID so
+ it is not possible that the two references are equal and are in different
+ partitions, but in myisam it is possible since we are comparing offsets.
+ Remove this assert if DB_ROW_ID is changed to be per partition.
+ */
+ DBUG_ASSERT(!m_innodb);
+
diff1= ref2[1] - ref1[1];
diff2= ref2[0] - ref1[0];
if (diff1 > 0)
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 3540dd8c8ab..f9a6f4b3fcf 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2011, Monty Program Ab
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index ccdf93ebaab..9504be57a90 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1,7 +1,7 @@
#ifndef ITEM_CMPFUNC_INCLUDED
#define ITEM_CMPFUNC_INCLUDED
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2009, 2011, Monty Program Ab
+ Copyright (c) 2009, 2011, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/item_func.h b/sql/item_func.h
index f1dbbb09305..0d9901d90b2 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1,7 +1,7 @@
#ifndef ITEM_FUNC_INCLUDED
#define ITEM_FUNC_INCLUDED
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 1b0f8c6acc0..469e8d2ac1c 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1005,6 +1005,7 @@ String *Item_func_reverse::val_str(String *str)
if ((l= my_ismbchar(res->charset(),ptr,end)))
{
tmp-= l;
+ DBUG_ASSERT(tmp >= tmp_value.ptr());
memcpy(tmp,ptr,l);
ptr+= l;
}
@@ -1753,18 +1754,35 @@ String *Item_func_trim::val_str(String *str)
ptr= (char*) res->ptr();
end= ptr+res->length();
r_ptr= remove_str->ptr();
- while (ptr+remove_length <= end && !memcmp(ptr,r_ptr,remove_length))
- ptr+=remove_length;
#ifdef USE_MB
if (use_mb(res->charset()))
{
+ while (ptr + remove_length <= end)
+ {
+ uint num_bytes= 0;
+ while (num_bytes < remove_length)
+ {
+ uint len;
+ if ((len= my_ismbchar(res->charset(), ptr + num_bytes, end)))
+ num_bytes+= len;
+ else
+ ++num_bytes;
+ }
+ if (num_bytes != remove_length)
+ break;
+ if (memcmp(ptr, r_ptr, remove_length))
+ break;
+ ptr+= remove_length;
+ }
char *p=ptr;
register uint32 l;
loop:
while (ptr + remove_length < end)
{
- if ((l=my_ismbchar(res->charset(), ptr,end))) ptr+=l;
- else ++ptr;
+ if ((l= my_ismbchar(res->charset(), ptr,end)))
+ ptr+= l;
+ else
+ ++ptr;
}
if (ptr + remove_length == end && !memcmp(ptr,r_ptr,remove_length))
{
@@ -1777,6 +1795,8 @@ String *Item_func_trim::val_str(String *str)
else
#endif /* USE_MB */
{
+ while (ptr+remove_length <= end && !memcmp(ptr,r_ptr,remove_length))
+ ptr+=remove_length;
while (ptr + remove_length <= end &&
!memcmp(end-remove_length,r_ptr,remove_length))
end-=remove_length;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 10a04abb6df..0395c856817 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2008, 2013 Monty Program Ab
+ Copyright (c) 2008, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1094,18 +1094,19 @@ void Aggregator_distinct::endup()
endup_done= TRUE;
}
}
- else
- {
- /*
- We don't have a tree only if 'setup()' hasn't been called;
- this is the case of sql_select.cc:return_zero_rows.
- */
- if (tree)
- table->field[0]->set_notnull();
- }
+ /*
+ We don't have a tree only if 'setup()' hasn't been called;
+ this is the case of sql_executor.cc:return_zero_rows.
+ */
if (tree && !endup_done)
{
+ /*
+ All tree's values are not NULL.
+ Note that value of field is changed as we walk the tree, in
+ Aggregator_distinct::unique_walk_function, but it's always not NULL.
+ */
+ table->field[0]->set_notnull();
/* go over the tree of distinct keys and calculate the aggregate value */
use_distinct_values= TRUE;
tree_walk_action func;
@@ -1401,7 +1402,7 @@ bool Item_sum_sum::add()
{
my_decimal value;
const my_decimal *val= aggr->arg_val_decimal(&value);
- if (!aggr->arg_is_null())
+ if (!aggr->arg_is_null(true))
{
my_decimal_add(E_DEC_FATAL_ERROR, dec_buffs + (curr_dec_buff^1),
val, dec_buffs + curr_dec_buff);
@@ -1412,7 +1413,7 @@ bool Item_sum_sum::add()
else
{
sum+= aggr->arg_val_real();
- if (!aggr->arg_is_null())
+ if (!aggr->arg_is_null(true))
null_value= 0;
}
DBUG_RETURN(0);
@@ -1538,9 +1539,27 @@ double Aggregator_simple::arg_val_real()
}
-bool Aggregator_simple::arg_is_null()
+bool Aggregator_simple::arg_is_null(bool use_null_value)
{
- return item_sum->args[0]->null_value;
+ Item **item= item_sum->args;
+ const uint item_count= item_sum->arg_count;
+ if (use_null_value)
+ {
+ for (uint i= 0; i < item_count; i++)
+ {
+ if (item[i]->null_value)
+ return true;
+ }
+ }
+ else
+ {
+ for (uint i= 0; i < item_count; i++)
+ {
+ if (item[i]->maybe_null && item[i]->is_null())
+ return true;
+ }
+ }
+ return false;
}
@@ -1558,10 +1577,17 @@ double Aggregator_distinct::arg_val_real()
}
-bool Aggregator_distinct::arg_is_null()
+bool Aggregator_distinct::arg_is_null(bool use_null_value)
{
- return use_distinct_values ? table->field[0]->is_null() :
- item_sum->args[0]->null_value;
+ if (use_distinct_values)
+ {
+ const bool rc= table->field[0]->is_null();
+ DBUG_ASSERT(!rc); // NULLs are never stored in 'tree'
+ return rc;
+ }
+ return use_null_value ?
+ item_sum->args[0]->null_value :
+ (item_sum->args[0]->maybe_null && item_sum->args[0]->is_null());
}
@@ -1579,11 +1605,8 @@ void Item_sum_count::clear()
bool Item_sum_count::add()
{
- for (uint i=0; i<arg_count; i++)
- {
- if (args[i]->maybe_null && args[i]->is_null())
- return 0;
- }
+ if (aggr->arg_is_null(false))
+ return 0;
count++;
return 0;
}
@@ -1675,7 +1698,7 @@ bool Item_sum_avg::add()
{
if (Item_sum_sum::add())
return TRUE;
- if (!aggr->arg_is_null())
+ if (!aggr->arg_is_null(true))
count++;
return FALSE;
}
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 27748d214dd..f074cc6c822 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -57,19 +57,8 @@ protected:
/* the aggregate function class to act on */
Item_sum *item_sum;
- /**
- When feeding back the data in endup() from Unique/temp table back to
- Item_sum::add() methods we must read the data from Unique (and not
- recalculate the functions that are given as arguments to the aggregate
- function.
- This flag is to tell the add() methods to take the data from the Unique
- instead by calling the relevant val_..() method
- */
-
- bool use_distinct_values;
-
public:
- Aggregator (Item_sum *arg): item_sum(arg), use_distinct_values(FALSE) {}
+ Aggregator (Item_sum *arg): item_sum(arg) {}
virtual ~Aggregator () {} /* Keep gcc happy */
enum Aggregator_type { SIMPLE_AGGREGATOR, DISTINCT_AGGREGATOR };
@@ -106,10 +95,16 @@ public:
/** Floating point value of being-aggregated argument */
virtual double arg_val_real() = 0;
/**
- NULLness of being-aggregated argument; can be called only after
- arg_val_decimal() or arg_val_real().
+ NULLness of being-aggregated argument.
+
+ @param use_null_value Optimization: to determine if the argument is NULL
+ we must, in the general case, call is_null() on it, which itself might
+ call val_*() on it, which might be costly. If you just have called
+ arg_val*(), you can pass use_null_value=true; this way, arg_is_null()
+ might avoid is_null() and instead do a cheap read of the Item's null_value
+ (updated by arg_val*()).
*/
- virtual bool arg_is_null() = 0;
+ virtual bool arg_is_null(bool use_null_value) = 0;
};
@@ -495,7 +490,7 @@ public:
Item *get_arg(uint i) { return args[i]; }
Item *set_arg(uint i, THD *thd, Item *new_val);
- uint get_arg_count() { return arg_count; }
+ uint get_arg_count() const { return arg_count; }
/* Initialization of distinct related members */
void init_aggregator()
@@ -626,10 +621,20 @@ class Aggregator_distinct : public Aggregator
*/
bool always_null;
+ /**
+ When feeding back the data in endup() from Unique/temp table back to
+ Item_sum::add() methods we must read the data from Unique (and not
+ recalculate the functions that are given as arguments to the aggregate
+ function.
+ This flag is to tell the arg_*() methods to take the data from the Unique
+ instead of calling the relevant val_..() method.
+ */
+ bool use_distinct_values;
+
public:
Aggregator_distinct (Item_sum *sum) :
Aggregator(sum), table(NULL), tmp_table_param(NULL), tree(NULL),
- always_null(FALSE) {}
+ always_null(false), use_distinct_values(false) {}
virtual ~Aggregator_distinct ();
Aggregator_type Aggrtype() { return DISTINCT_AGGREGATOR; }
@@ -639,7 +644,7 @@ public:
void endup();
virtual my_decimal *arg_val_decimal(my_decimal * value);
virtual double arg_val_real();
- virtual bool arg_is_null();
+ virtual bool arg_is_null(bool use_null_value);
bool unique_walk_function(void *element);
bool unique_walk_function_for_count(void *element);
@@ -666,7 +671,7 @@ public:
void endup() {};
virtual my_decimal *arg_val_decimal(my_decimal * value);
virtual double arg_val_real();
- virtual bool arg_is_null();
+ virtual bool arg_is_null(bool use_null_value);
};
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index e238668d6ab..064038a06fe 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2005, 2013, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -226,6 +226,9 @@ public:
{
max_length= MAX_BLOB_WIDTH;
collation.collation= pxml->charset();
+ // To avoid premature evaluation, mark all nodeset functions as non-const.
+ used_tables_cache= RAND_TABLE_BIT;
+ const_item_cache= false;
}
const char *func_name() const { return "nodeset"; }
bool check_vcol_func_processor(uchar *int_arg)
diff --git a/sql/key.cc b/sql/key.cc
index 0d3db2d5bf5..110b13000ed 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/key.h b/sql/key.h
index 0eeda58cd17..f5f9a19178c 100644
--- a/sql/key.h
+++ b/sql/key.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/lex_symbol.h b/sql/lex_symbol.h
index 5f3c70a50a4..d48ca57df85 100644
--- a/sql/lex_symbol.h
+++ b/sql/lex_symbol.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2001, 2004 MySQL AB
+/* Copyright (c) 2000, 2001, 2004, 2006, 2007 MySQL AB
+ Use is subject to license terms
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/log.cc b/sql/log.cc
index 881eeafcb97..d129fcbe8a9 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 73686a2fd0c..826a45f6da8 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -19,6 +19,7 @@
#ifdef MYSQL_CLIENT
#include "sql_priv.h"
+#include "mysqld_error.h"
#else
@@ -2250,6 +2251,14 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
else
{
my_b_printf(file, "### @%d=", i + 1);
+ size_t fsize= td->calc_field_size((uint)i, (uchar*) value);
+ if (value + fsize > m_rows_end)
+ {
+ my_b_printf(file, "***Corrupted replication event was detected."
+ " Not printing the value***\n");
+ value+= fsize;
+ return 0;
+ }
size_t size= log_event_print_value(file, value,
td->type(i), td->field_metadata(i),
typestr, sizeof(typestr));
@@ -5162,11 +5171,22 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
fields = (char*)field_lens + num_fields;
table_name = fields + field_block_len;
db = table_name + table_name_len + 1;
+ DBUG_EXECUTE_IF ("simulate_invalid_address",
+ db_len = data_len;);
fname = db + db_len + 1;
+ if ((db_len > data_len) || (fname > buf_end))
+ goto err;
fname_len = (uint) strlen(fname);
+ if ((fname_len > data_len) || (fname + fname_len > buf_end))
+ goto err;
// null termination is accomplished by the caller doing buf[event_len]=0
DBUG_RETURN(0);
+
+err:
+ // Invalid event.
+ table_name = 0;
+ DBUG_RETURN(1);
}
diff --git a/sql/log_event.h b/sql/log_event.h
index 8429f7f0b01..1d90111f1ca 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -3907,13 +3907,8 @@ protected:
DBUG_ASSERT(m_table);
ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT);
- int const result= ::unpack_row(rli, m_table, m_width, m_curr_row,
- m_rows_end, &m_cols,
- &m_curr_row_end, &m_master_reclength);
- if (m_curr_row_end > m_rows_end)
- my_error(ER_SLAVE_CORRUPT_EVENT, MYF(0));
- ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT);
- return result;
+ return ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
+ &m_curr_row_end, &m_master_reclength, m_rows_end);
}
#endif
diff --git a/sql/log_event_old.h b/sql/log_event_old.h
index 0034bb9d142..d9d9f25737b 100644
--- a/sql/log_event_old.h
+++ b/sql/log_event_old.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 MySQL AB.
+/* Copyright (c) 2007, 2013, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -203,11 +203,8 @@ protected:
{
DBUG_ASSERT(m_table);
ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT);
- int const result= ::unpack_row(rli, m_table, m_width, m_curr_row,
- m_rows_end, &m_cols,
- &m_curr_row_end, &m_master_reclength);
- ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT);
- return result;
+ return ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
+ &m_curr_row_end, &m_master_reclength, m_rows_end);
}
#endif
diff --git a/sql/mem_root_array.h b/sql/mem_root_array.h
index 9dc9638c13f..2dcc475cd7b 100644
--- a/sql/mem_root_array.h
+++ b/sql/mem_root_array.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index 4b1c7f647b1..22ae38bef41 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -1,5 +1,5 @@
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates.
- Copyright (c) 2011 Monty Program Ab
+/* Copyright (c) 2005, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index b41cb8126f1..dcc9aec97a6 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2008, 2012, Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -5181,7 +5181,7 @@ default_service_handling(char **argv,
/* We have to quote filename if it contains spaces */
pos= add_quoted_string(path_and_service, file_path, end);
- if (*extra_opt)
+ if (extra_opt && *extra_opt)
{
/*
Add option after file_path. There will be zero or one extra option. It's
diff --git a/sql/mysqld.h b/sql/mysqld.h
index fc7e8f27fc4..56c48d3d23f 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/partition_element.h b/sql/partition_element.h
index 4f03d91035a..75033d3552f 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -1,7 +1,7 @@
#ifndef PARTITION_ELEMENT_INCLUDED
#define PARTITION_ELEMENT_INCLUDED
-/* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/partition_info.h b/sql/partition_info.h
index ffd6e25c45c..cff941a858a 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -1,7 +1,7 @@
#ifndef PARTITION_INFO_INCLUDED
#define PARTITION_INFO_INCLUDED
-/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index 9edbfc05677..9103cad337d 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 99bf8a82004..db65cfa8757 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -1,6 +1,5 @@
-/*
- Copyright (c) 2007, 2010, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+/* Copyright (c) 2007, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -171,11 +170,15 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
@param row_data
Packed row data
@param cols Pointer to bitset describing columns to fill in
- @param row_end Pointer to variable that will hold the value of the
- one-after-end position for the row
+ @param curr_row_end
+ Pointer to variable that will hold the value of the
+ one-after-end position for the current row
@param master_reclength
Pointer to variable that will be set to the length of the
record on the master side
+ @param row_end
+ Pointer to variable that will hold the value of the
+ end position for the data in the row event
@retval 0 No error
@@ -188,9 +191,9 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
int
unpack_row(Relay_log_info const *rli,
TABLE *table, uint const colcnt,
- uchar const *const row_data, uchar const *const row_buffer_end,
- MY_BITMAP const *cols,
- uchar const **const row_end, ulong *const master_reclength)
+ uchar const *const row_data, MY_BITMAP const *cols,
+ uchar const **const current_row_end, ulong *const master_reclength,
+ uchar const *const row_end)
{
DBUG_ENTER("unpack_row");
DBUG_ASSERT(row_data);
@@ -305,7 +308,7 @@ unpack_row(Relay_log_info const *rli,
#ifndef DBUG_OFF
uchar const *const old_pack_ptr= pack_ptr;
#endif
- pack_ptr= f->unpack(f->ptr, pack_ptr, row_buffer_end, metadata);
+ pack_ptr= f->unpack(f->ptr, pack_ptr, row_end, metadata);
DBUG_PRINT("debug", ("field: %s; metadata: 0x%x;"
" pack_ptr: 0x%lx; pack_ptr': 0x%lx; bytes: %d",
f->field_name, metadata,
@@ -392,7 +395,7 @@ unpack_row(Relay_log_info const *rli,
DBUG_DUMP("row_data", row_data, pack_ptr - row_data);
- *row_end = pack_ptr;
+ *current_row_end = pack_ptr;
if (master_reclength)
{
if (*field_ptr)
diff --git a/sql/rpl_record.h b/sql/rpl_record.h
index 4b34dcd0a96..d4eb8986846 100644
--- a/sql/rpl_record.h
+++ b/sql/rpl_record.h
@@ -1,6 +1,5 @@
-/*
- Copyright (c) 2007, 2010, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+/* Copyright (c) 2007, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2013, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,9 +32,9 @@ size_t pack_row(TABLE* table, MY_BITMAP const* cols,
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int unpack_row(Relay_log_info const *rli,
TABLE *table, uint const colcnt,
- uchar const *const row_data, uchar const *row_buffer_end,
- MY_BITMAP const *cols,
- uchar const **const row_end, ulong *const master_reclength);
+ uchar const *const row_data, MY_BITMAP const *cols,
+ uchar const **const curr_row_end, ulong *const master_reclength,
+ uchar const *const row_end);
// Fill table's record[0] with default values.
int prepare_record(TABLE *const table, const uint skip, const bool check);
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 59d92a7f09f..22241da1348 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -186,7 +186,7 @@ int compare_lengths(Field *field, enum_field_types source_type, uint16 metadata)
DBUG_PRINT("result", ("%d", result));
DBUG_RETURN(result);
}
-
+#endif //MYSQL_CLIENT
/*********************************************************************
* table_def member definitions *
*********************************************************************/
@@ -197,7 +197,7 @@ int compare_lengths(Field *field, enum_field_types source_type, uint16 metadata)
*/
uint32 table_def::calc_field_size(uint col, uchar *master_data) const
{
- uint32 length;
+ uint32 length= 0;
switch (type(col)) {
case MYSQL_TYPE_NEWDECIMAL:
@@ -285,7 +285,6 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) const
case MYSQL_TYPE_VARCHAR:
{
length= m_field_metadata[col] > 255 ? 2 : 1; // c&p of Field_varstring::data_length()
- DBUG_ASSERT(uint2korr(master_data) > 0);
length+= length == 1 ? (uint32) *master_data : uint2korr(master_data);
break;
}
@@ -295,17 +294,6 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) const
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_GEOMETRY:
{
-#if 1
- /*
- BUG#29549:
- This is currently broken for NDB, which is using big-endian
- order when packing length of BLOB. Once they have decided how to
- fix the issue, we can enable the code below to make sure to
- always read the length in little-endian order.
- */
- Field_blob fb(m_field_metadata[col]);
- length= fb.get_packed_size(master_data);
-#else
/*
Compute the length of the data. We cannot use get_length() here
since it is dependent on the specific table (and also checks the
@@ -331,7 +319,6 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) const
}
length+= m_field_metadata[col];
-#endif
break;
}
default:
@@ -340,7 +327,7 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) const
return length;
}
-
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
/**
*/
void show_sql_type(enum_field_types type, uint16 metadata, String *str, CHARSET_INFO *field_cs)
diff --git a/sql/set_var.cc b/sql/set_var.cc
index d4ca335e959..9efa29d8041 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
- Copyright (c) 2008, 2011, Monty Program Ab
+ Copyright (c) 2008, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/set_var.h b/sql/set_var.h
index 2b3a376488b..32207e834d9 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -1,6 +1,7 @@
#ifndef SET_VAR_INCLUDED
#define SET_VAR_INCLUDED
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml
index e82ffc85ea6..3e402226a34 100644
--- a/sql/share/charsets/Index.xml
+++ b/sql/share/charsets/Index.xml
@@ -3,7 +3,7 @@
<charsets max-id="99">
<copyright>
- Copyright (c) 2003, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2003-2005 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/armscii8.xml b/sql/share/charsets/armscii8.xml
index 52382c83af0..c1eb93b1f91 100644
--- a/sql/share/charsets/armscii8.xml
+++ b/sql/share/charsets/armscii8.xml
@@ -3,7 +3,8 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2004 MySQL AB
+ Use is subject to license terms
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/ascii.xml b/sql/share/charsets/ascii.xml
index bec34ad525e..29336b3a665 100644
--- a/sql/share/charsets/ascii.xml
+++ b/sql/share/charsets/ascii.xml
@@ -3,7 +3,7 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2007 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/cp1250.xml b/sql/share/charsets/cp1250.xml
index 58e55de9bdc..1b4a71ef6d5 100644
--- a/sql/share/charsets/cp1250.xml
+++ b/sql/share/charsets/cp1250.xml
@@ -3,7 +3,7 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2005 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/cp852.xml b/sql/share/charsets/cp852.xml
index 7608296d5b7..e0c574d2ea1 100644
--- a/sql/share/charsets/cp852.xml
+++ b/sql/share/charsets/cp852.xml
@@ -3,7 +3,8 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2004 MySQL AB
+ Use is subject to license terms
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/hebrew.xml b/sql/share/charsets/hebrew.xml
index e7f896a3e12..0544b27ef4f 100644
--- a/sql/share/charsets/hebrew.xml
+++ b/sql/share/charsets/hebrew.xml
@@ -3,7 +3,7 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/latin1.xml b/sql/share/charsets/latin1.xml
index 8963c3481d3..4054eea8d33 100644
--- a/sql/share/charsets/latin1.xml
+++ b/sql/share/charsets/latin1.xml
@@ -3,7 +3,7 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2005 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/latin2.xml b/sql/share/charsets/latin2.xml
index 183da7b6cd3..a44ec7e0ec6 100644
--- a/sql/share/charsets/latin2.xml
+++ b/sql/share/charsets/latin2.xml
@@ -3,7 +3,7 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2005 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/latin5.xml b/sql/share/charsets/latin5.xml
index 489299564f1..6b60e58cdda 100644
--- a/sql/share/charsets/latin5.xml
+++ b/sql/share/charsets/latin5.xml
@@ -3,7 +3,7 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2005 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 33b0fd13267..b0c67fbfe32 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates.
- Copyright (c) 2011, Monty Program Ab.
+/* Copyright (c) 2011, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/slave.cc b/sql/slave.cc
index 3c17f102a7f..0d762199323 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2008, 2011, Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 2c7a835fa8c..721d49a7f88 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_admin.h b/sql/sql_admin.h
index 5398e3019f1..43d8f70c6f4 100644
--- a/sql/sql_admin.h
+++ b/sql/sql_admin.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index f287bf47e81..36026a39616 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2013, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index abf448fdac4..1dab45800d9 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index 2e932a53d07..9acd4abbdca 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -1,7 +1,7 @@
#ifndef SQL_AUDIT_INCLUDED
#define SQL_AUDIT_INCLUDED
-/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 3bb5deab406..420bd0eb2f0 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2005, 2013, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h
index 6a26ad5bb2b..d286d8e1ef0 100644
--- a/sql/sql_bitmap.h
+++ b/sql/sql_bitmap.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 7e0b659a3e4..041d2a545df 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2007, 2012, Oracle and/or its affiliates.
- Copyright (c) 2008, 2012, Monty Program Ab
+ Copyright (c) 2007, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index d3c36e2c5d7..844810af0f4 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -1,5 +1,4 @@
-/*
- Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2002, 2012, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc
index 9d014790929..778c732d443 100644
--- a/sql/sql_manager.cc
+++ b/sql/sql_manager.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index b9bf3dbc217..a03dcc5c16e 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 1ada66e01fb..726d1944052 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2005, 2012, Oracle and/or its affiliates.
- Copyright (c) 2010, 2013, Monty Program Ab
+ Copyright (c) 2005, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 124af78ed61..dac4077430c 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -655,7 +655,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
set_timespec_nsec(*heartbeat_ts, 0);
}
if (global_system_variables.log_warnings > 1)
- sql_print_information("Start binlog_dump to slave_server(%d), pos(%s, %lu)",
+ sql_print_information("Start binlog_dump to slave_server(%u), pos(%s, %lu)",
thd->server_id, log_ident, (ulong)pos);
if (RUN_HOOK(binlog_transmit, transmit_start, (thd, flags, log_ident, pos)))
{
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 4f3ec940cef..126ecebcc24 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -1,5 +1,4 @@
-/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index dd1c92af6f4..dfb6ace57f4 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2004, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2004, 2012, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 74e80cdebfd..7be370b8e63 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates.
- Copyright (c) 2011 Monty Program Ab
+/* Copyright (c) 2004, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index 2b3df48cf74..06bd92e0bc7 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/table.cc b/sql/table.cc
index bb650130816..cccda4e76fc 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1,6 +1,5 @@
-/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/table.h b/sql/table.h
index 16d19271a1f..83b2a7a99a9 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1,7 +1,7 @@
#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009, 2011 Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/transaction.h b/sql/transaction.h
index abe7823cf9b..54b25f1de2a 100644
--- a/sql/transaction.h
+++ b/sql/transaction.h
@@ -1,5 +1,4 @@
-/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by