Bug#17063675 USE OF UNINITIALIZED PTHREAD_GETSPECIFIC() KEY IN DEBUG BUILDS

Before this fix, code that uses DBUG_ENTER() and related macros,
when executed very early in the server initialization, typically
when using C++ constructors in static code, could end up executing
my_pthread_getspecific() with a non initialized pthread_key.

The behavior in this case is undefined, and can potentially cause a crash.

This fix is a backport from MySQL 5.7,
which uses a THR_KEY_mysys_initialized variable to keep track of 
the initialization state.

With this fix, calling DBUG_ENTER() and related macro is more robust,
and does nothing when the debug component is not available.
Automerge lp:~laurynas-biveinis/percona-server/buf-mutex-split-fixes-5.1
Automerge lp:~laurynas-biveinis/percona-server/c-change-2013-5.1
Automerge lp:~laurynas-biveinis/percona-server/fake-changes-binlog-5.1
Local merge
Raise version number after cloning 5.6.14
- merge with trunk to resolve the conflicts
Raise version number after cloning 5.5.34
Empty version change upmerge
Merge lp:~hrvojem/percona-server/rn-5.1.71-14.9-5.1
http://jenkins.percona.com/job/merge-PS-5.1-docs-kickoff/22/
BUG#16857395 - EXCESSIVE MEMORY USAGE AFTER REPEATED TRIGGER
               EXCEPTION HANDLERS

Follow up patch to fix the valgrind failure.
Merge added parameters to build-binary.sh
Bump versions to 5.1.71-14.9
Additional test fix for Bug#16083211
Merge to mysql-5.6 (backport)
Bug#16346241 - SERVER CRASH IN ITEM_PARAM::QUERY_VAL_STR

Problem:-
Second execution of prepared statement for query with 
parameter in limit clause, causes an assert when using 
connectors (e.g., Connector C).  


Analysis:-
In prepared statement, LIMIT parameters can be
specified using '?' markers. Value for the parameter can
be supplied while executing the prepared statement.

Passing string, float or double values for LIMIT clause
works well from command-line client. That's because, while 
setting the LIMIT parameter value from a user-variable,
the value is converted to integer value.

However, when prepared statement is executed from other
interfaces as J connectors, or C applications etc,
the value for the parameters are sent to the server
with execute command. Each item in command has value and
the data TYPE. So, while setting parameter values
from this log, value is set to all the parameters
with the same data type as passed.
Here, we have the logic to convert the value to change the 
state and item_type if it is part of LIMIT parameter and 
its item_type is not INT.
But when we reset this parameter we save the item_type but change 
state. So on second execution we have old item_type but our state 
has been changed, which make us to use string type variable 
in Item_param::query_str_val(). This cause an assert.

Fix:
Instead of checking the item_type of the parameter, check for 
the state of the parameter. As state value are reset everytime
we execute the statement.
Bug#16346241 - SERVER CRASH IN ITEM_PARAM::QUERY_VAL_STR
	"Merge fix  from mysql-5.5 to mysql-5.6"
BUG#17294150-POTENTIAL CRASH DUE TO BUFFER OVERRUN IN SSL 
             ERROR HANDLING CODE 

BACKGROUND:
There can be a potential crash due to buffer overrun in 
SSL error handling code due to missing comma in
ssl_error_string[] array in viosslfactories.c.

ANALYSIS:
Found by code Inspection.

FIX:
Added the missing comma in SSL error handling code
in ssl_error_string[] array in viosslfactories.c.
BUG#17294150-POTENTIAL CRASH DUE TO BUFFER OVERRUN IN SSL 
             ERROR HANDLING CODE 

BACKGROUND:
There can be a potential crash due to buffer overrun in 
SSL error handling code due to missing comma in
ssl_error_string[] array in viosslfactories.c.

ANALYSIS:
Found by code Inspection.

FIX:
Added the missing comma in SSL error handling code
in ssl_error_string[] array in viosslfactories.c.
BUG#17294150-POTENTIAL CRASH DUE TO BUFFER OVERRUN IN SSL 
             ERROR HANDLING CODE 

BACKGROUND:
There can be a potential crash due to buffer overrun in 
SSL error handling code due to missing comma in
ssl_error_string[] array in viosslfactories.c.

ANALYSIS:
Found by code Inspection.

FIX:
Added the missing comma in SSL error handling code
in ssl_error_string[] array in viosslfactories.c.