Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-523

java.sql.SQLException: Could not set parameter at position 1 (values was 'admin')

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Cannot Reproduce
    • 2.1.1, 1.6.4
    • N/A
    • JDBC 4.2 compatibility
    • None
    • java 1.8 with 2.1.1 version binary.
      java 1.7 with 1.6.4 version binary.

    Description

      Query Execution failed with below error.

      java.sql.SQLException: Could not set parameter at position 1 (values was 'admin')

      below query we are using.
      SELECT CONCAT('<img style=\"width:30px;height:26px;\" src=\"http://${ip}/assets/logos/',IF(image_url IS NULL OR image_url=\"\",'${IP}/assets/images/default-logo.gif',image_url),'\"onmouseout=\"funCloseLogoImage()\" onmouseover=\"funOpenLogoImage(event,\\'',\"${IP}/assets/logos//\",IF(image_url IS NULL OR image_url=\"\",'${IP}/assets/images/default-logo.gif',image_url),'\\')\" style=\"width:30px;height:26px;\"') AS imageurl,CONCAT(' <img class=\"updatePandL\" src=\\'${IP}/as/icons/Edit.png
      ' alt=
      'Edit
      ' title=
      'Edit
      ' onclick=\"funEdit(
      '', CAST(id AS CHAR),'\\')\");\"/> <img class=\"deletePandL\" src=\\'${IP}/Delete.png
      ' alt=\\'View
      ' title=
      'Delete
      ' onclick=\"funDelete(
      '', CAST(id AS CHAR),''',''',pl_name,'\\')\");\"/>') AS Actions table WHERE 1=1 AND created_by=?

      same query executing in 1.5.9 version

      Attachments

        Activity

          banesh banesh banna created issue -
          diego dupin Diego Dupin added a comment -

          Trying to reproduced without success for the moment.
          Could you please send connection string and server variable @SQL_MODE ?

          Error i have is (normal since there is no FROM keyword) :

          java.sql.SQLSyntaxErrorException: (conn=1521) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'table WHERE 1=1  AND created_by='t'' at line 1
          	at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:146)
          	at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:107)
          	at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:235)
          	at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:224)
          	at org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)
          	at org.mariadb.jdbc.Testt.tt(Testt.java:36)
          
          

          diego dupin Diego Dupin added a comment - Trying to reproduced without success for the moment. Could you please send connection string and server variable @SQL_MODE ? Error i have is (normal since there is no FROM keyword) : java.sql.SQLSyntaxErrorException: (conn= 1521 ) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'table WHERE 1=1 AND created_by=' t '' at line 1 at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java: 146 ) at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java: 107 ) at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java: 235 ) at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java: 224 ) at org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java: 159 ) at org.mariadb.jdbc.Testt.tt(Testt.java: 36 )
          diego dupin Diego Dupin added a comment -

          closing since unable to reproduce error and no answer since 2 month.
          Feel free to re-open it if issue occur.

          diego dupin Diego Dupin added a comment - closing since unable to reproduce error and no answer since 2 month. Feel free to re-open it if issue occur.
          diego dupin Diego Dupin made changes -
          Field Original Value New Value
          Fix Version/s N/A [ 22125 ]
          Resolution Cannot Reproduce [ 5 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 82538 ] MariaDB v4 [ 135015 ]

          People

            diego dupin Diego Dupin
            banesh banesh banna
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.