This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224260 - Update JDBC Drivers (was OPTION SQL_SELECT_LIMIT=DEFAULT)
Summary: Update JDBC Drivers (was OPTION SQL_SELECT_LIMIT=DEFAULT)
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
: 228696 229966 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-12-27 15:05 UTC by antagonist
Modified: 2014-02-16 11:24 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed Patch (10.30 KB, patch)
2013-02-21 14:11 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description antagonist 2012-12-27 15:05:52 UTC
Whenever I execute SELECT * FROM table
I get this error:

Error code 1064, SQL state 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1

I think , I use the latest release of mysql server 

+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| innodb_version          | 1.2.6                        |
| protocol_version        | 10                           |
| slave_type_conversions  |                              |
| version                 | 5.6.6-m9-log                 |
| version_comment         | MySQL Community Server (GPL) |
| version_compile_machine | x86_64                       |
| version_compile_os      | debian6.0                    |
+-------------------------+------------------------------+

it seems like MySQL have deprecated this syntax OPTION SQL_SELECT_LIMIT=DEFAULT
Comment 1 matthias42 2012-12-28 14:28:05 UTC
Some google foo lead me to this:

http://bugs.mysql.com/bug.php?id=66659

That bug report sound pretty much like your problem - there is no good fix for you. But there is a lead for some more reading.

The similarity to you problem:

1. It's also the jdbc driver involved
2. The error message is the same
3. the problem occurs on a very recent mysql server version

So I tried to find the problem in the mysql-connector-java sources and found the statement in StatementImpl.java in version 5.1.18 - an older version can be found here:

http://www.docjar.com/html/api/com/mysql/jdbc/StatementImpl.java.html

Look for "SET OPTION SQL_SELECT_LIMIT=DEFAULT" in the file and you will find it.

I also checked the most recent version

I checked the source of mysql-connector-java 5.1.22 and the problem seems to be fixed:

SET SQL_SELECT_LIMIT=DEFAULT

So suggested fix for the user: Please download the newer version of connector/j and modify the driver entry in databases.

Suggested fix: Update bundled connector/j version
Comment 2 Jaroslav Havlin 2013-01-07 15:34:27 UTC
It's too risky to change the bundled MySQL driver in 7.3.
We should update it in the next release.

Matthias, thank you very much for evaluation.
Comment 3 tomzi 2013-02-07 17:56:02 UTC
I have the same problem:
I installed MySQL Server 5.6.10 and Netbeans through me the exact error. Then I found this bug descriptions and I look for a newer mysql jdbc driver, I found this one: 
http://www.mysql.de/downloads/mirror.php?id=412054

saved the jar file next to the old one in the netbeans folder .../NetBeans 7.3 RC1\ide\modules\ext and changed the driver within Netbeans under Services/Databases/Drivers/MySQL (Connector/J driver)/Customize

Now it works like a charm :) So far... :)
Comment 4 Jaroslav Havlin 2013-02-21 14:11:34 UTC
Created attachment 131676 [details]
Proposed Patch

Updating MySQL driver to version 5.1.23 and PostgreSQL driver to 9.2-1002.
Comment 5 Jaroslav Havlin 2013-02-21 14:20:12 UTC
Some of modified files contain this comment:

<!-- please check with mkleint@netbeans.org before/after updating this or "classpath" section -->

So, Milos, please, could you check the patch.

File postgresql-9.2-1002-license.txt contained different newline characters. The patch changes them to line-feed. Is it OK?

Thanks.
Comment 6 Milos Kleint 2013-02-21 14:37:36 UTC
(In reply to comment #5)
> Some of modified files contain this comment:
> 
> <!-- please check with mkleint@netbeans.org before/after updating this or
> "classpath" section -->
> 
> So, Milos, please, could you check the patch.


looks good to me.

Milos
Comment 7 Jaroslav Havlin 2013-02-21 16:04:59 UTC
Thank you for checking it.

Fixed in http://hg.netbeans.org/core-main/rev/f584da6419a9
Comment 8 Quality Engineering 2013-02-23 04:09:24 UTC
Integrated into 'main-golden', will be available in build *201302222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f584da6419a9
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #224260: Update JDBC drivers
Comment 9 Ralph Ruijs 2013-04-18 18:01:01 UTC
*** Bug 228696 has been marked as a duplicate of this bug. ***
Comment 10 ddw 2013-04-19 16:55:18 UTC
I'm still struggling with this error message. Comment 3's suggestion didn't help in my case. I have a new Mysql driver already. With regards to comment 1, my statementImpl.java file already looks updated and not deprecated (thus without the set option command). What else can I try to fix my program? I've noticed a proposed patch above, though how do I implement the code in the patch to fix the problem?
Comment 11 Jaroslav Havlin 2013-04-19 17:46:42 UTC
(In reply to comment #10)
> What else can I try to fix my program? I've
> noticed a proposed patch above, though how do I implement the code in
> the patch to fix the problem?
If you already have the latest JDBC driver, the patch will not help you (it only updates default drivers). Please ensure that the latest driver is correctly registered in NetBeans (check Services tab -> Databases -> Drivers), and that your connections are configured to use it.
Comment 12 ddw 2013-04-21 14:09:53 UTC
My code is now compiling correctly because I also deleting the old driver, instead of just installing the new driver. The following link also helped:

http://stackoverflow.com/questions/15113707/error-code-1064-sql-state-42000-you-have-an-error-in-your-sql-syntax?rq=1
Comment 13 Tomas Danek 2013-05-02 14:33:10 UTC
both drivers in new versions are present in NetBeans IDE Dev (Build 201304292301); I'll sanity test them during 7.3.1 functional testing.
Comment 14 Jaroslav Havlin 2013-05-03 06:47:10 UTC
(In reply to comment #13)
> both drivers in new versions are present in NetBeans IDE Dev (Build
> 201304292301); I'll sanity test them during 7.3.1 functional testing.
Thank you.
Integrated into release73: http://hg.netbeans.org/releases/rev/cf3d26e7202e
Comment 15 Quality Engineering 2013-05-05 00:26:50 UTC
Integrated into 'releases', will be available in build *201305042200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/cf3d26e7202e
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #224260: Update JDBC Drivers (in release73 branch)
Comment 16 Tomas Danek 2013-05-10 11:21:50 UTC
thanks, verified in 

Product Version: NetBeans IDE 7.3.1 (Build 201305082200)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b12
System: Mac OS X version 10.8.3 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.3
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.3
Comment 17 matthias42 2013-05-23 16:56:46 UTC
*** Bug 229966 has been marked as a duplicate of this bug. ***
Comment 18 Jackie_Rosen 2014-02-16 11:24:44 UTC
SPAM - Removed by Administrator