Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 871682

Summary: NullPointerException in mysql jdbc driver when specifying characterEncoding and sessionVariables
Product: Red Hat Enterprise Linux 6 Reporter: Sean Flanigan <sflaniga>
Component: mysql-connector-javaAssignee: Michal Schorm <mschorm>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: databases-maint, hhorak, praiskup, psklenar
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://bugs.mysql.com/bug.php?id=61201
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-10 08:17:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 947775, 1070830, 1159820    
Attachments:
Description Flags
backported patch from upstream bug none

Description Sean Flanigan 2012-10-31 03:47:52 UTC
Description of problem:
The mysql driver produces a SQLException/NullPointerException when connecting to a database with a URL like this:

jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8&sessionVariables=storage_engine=InnoDB


Version-Release number of selected component (if applicable):
mysql-connector-java 1:5.1.17-6.el6

How reproducible:
100%

Steps to Reproduce:
1. yum install bsh
2. save the following script as jdbctest.bsh
3. bsh jdbctest.bsh
  
jdbctest.bsh contents:

#!/usr/bin/bsh
addClassPath("/usr/share/java/mysql-connector-java.jar");
Properties props = new Properties();
props.put("user", "root");
props.put("password", "");
new com.mysql.jdbc.Driver().connect("jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8&sessionVariables=storage_engine=InnoDB", props);
System.out.println("success!");


Actual results:
Connection fails with an SQLException, caused by NullPointerException

Expected results:
Connection is successful.

Additional info:
This bug was reported upstream as http://bugs.mysql.com/bug.php?id=61201 which is marked as fixed in mysql-connector-java version 5.1.18.

Comment 3 RHEL Program Management 2013-10-14 00:19:39 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 5 Jakub Dorňák 2014-05-07 16:03:11 UTC
Created attachment 893363 [details]
backported patch from upstream bug

This patch backported from 5.1.18 resolves the issue.