Bug #40772 Meaningless warning message 'Invalid value {1} for server ...' is displayed.
Submitted: 17 Nov 2008 4:11 Modified: 23 Jun 2009 14:19
Reporter: Meiji KIMURA Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Jess Balint CPU Architecture:Any

[17 Nov 2008 4:11] Meiji KIMURA
Description:
When upgrading Connector/J from 3.1.14 to 5.1.7, I recieved such a message.

Mon Nov 17 11:43:18 JST 2008 WARN: Invalid value {1} for server variable named {0}, falling back to sane default of {2}

It is a meaningless message. I guess that {n} should be replace to a proper strings. I looked into the source code of Connector/J and it is defineded in LocalizedErrorMessagesproperties.

Connection.BadValueInServerVariables=Invalid value '{1}' for server variable named '{0}', falling back to sane default of '{2}'.

I supposed that '{n}' is not need single quatations. Single quatations make '{n}' as it is literal.

How to repeat:
(1) Set server variables 'max_allowed_packet' or 'net_buffer_length' to invalid values.
# These server variables use 'getServerVariableAsInt()' function. The function use the message I explained.
(2) Connect to server with Connector/J.

Suggested fix:
[Current Code]
Connection.BadValueInServerVariables=Invalid value '{1}' for server variable named '{0}', falling back to sane default of '{2}'.

[Suggested Fix]
Connection.BadValueInServerVariables=Invalid value {1} for server variable named {0}, falling back to sane default of {2}.

There are some '{n}' around above codes. Please check and fix them if needed.

LoadBalancingConnectionProxy.badValueForRetriesAllDown=Bad value '{0}' for property "retriesAllDown".
Connection.UnableToConnectWithRetries=Could not create connection to database server. \
Attempted reconnect {0} times. Giving up.

That's all.
[21 Jan 2009 2:14] Satish Koppisetty
When can we expect this to be resolved?
[2 Mar 2009 18:20] Jess Balint
fix quoted messages

Attachment: bug40772.diff (text/x-diff), 3.01 KiB.

[25 Mar 2009 18:56] Darryl Miles
I don't think this patch will correct the problem I am seeing (although it will fix the "meaningless" aspect of incorrect {0} usage).

I keep seeing this message repeatably on my logs during an upgrade from 5.1.6 to 5.1.7 change at mysql-connector-java-5.1.7/src/com/mysql/jdbc/ConnectionImpl.java line 3364:

this.autoIncrementIncrement = getServerVariableAsInt("auto_increment_increment", 1);

The above line was added.  But it seems for server version 4.0.31 at least this is NOT a server variable:

mysql> show variables like '%auto_increment_increment%';

Here is an example of something that _IS_ a server variable (referenced around line 3370 a few lines down).

mysql> show variables like '%lower_case_table_names%';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_table_names | 0     |
+------------------------+-------+
[25 Mar 2009 23:51] Darryl Miles
[Current Code /data/opt/mysql-connector-java-5.1.7/src/com/mysql/jdbc/ConnectionImpl.java:3364]
this.autoIncrementIncrement = getServerVariableAsInt("auto_increment_increment", 1);

[Suggested Fix]
if(versionMeetsMinimum(99, 99, 99))  /* If there really is a MySQL server version that does have this ServerVariable */
    this.autoIncrementIncrement = getServerVariableAsInt("auto_increment_increment", 1);
else
    this.autoIncrementIncrement = 1;
[26 Mar 2009 13:51] Darryl Miles
Comments above redirect http://bugs.mysql.com/bug.php?id=41416
[26 Mar 2009 17:02] Mark Matthews
The current fix has a version check:

if (versionMeetsMinimum(5, 0, 2)) { 
  ....
}
[2 Jun 2009 1:32] Jess Balint
Fix pushed, will be released in 5.1.8.
[23 Jun 2009 14:19] Tony Bedford
An entry was added to the 5.1.8 changelog:

Error message strings contained variable values that were not expanded. For example:

Mon Nov 17 11:43:18 JST 2008 WARN: Invalid value {1} for server variable named {0},
falling back to sane default of {2}