Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-70

fetching large packets via compressed connection returns unknown error.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • all

    Description

      static int test_conc69(MYSQL *my)
      {
        int rc;
        MYSQL_RES *res;
        MYSQL_ROW row;
        MYSQL *mysql= mysql_init(NULL);
       
        rc= mysql_options(mysql, MYSQL_OPT_COMPRESS, (void *)1);
        check_mysql_rc(rc, my);
       
        rc= mysql_query(my, "SET @save:=@@max_allowed_packet");
        check_mysql_rc(rc, my);
        rc= mysql_query(my, "SET GLOBAL max_allowed_packet=1024 * 1024 * 21");
        check_mysql_rc(rc, my);
       
        if (!mysql_real_connect(mysql, hostname, username,
                                   password, schema, port, socketname, 0))
        {
          diag("Error: %s", mysql_error(mysql));
          return FAIL;
        }
       
        rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
        check_mysql_rc(rc, mysql);
       
        rc= mysql_query(mysql, "CREATE TABLE t1 (a LONGBLOB)");
        check_mysql_rc(rc, mysql);
       
        rc= mysql_query(mysql, "INSERT INTO t1 VALUES (REPEAT('A', 1024 * 1024 * 20))");
        check_mysql_rc(rc, mysql);
       
        rc= mysql_query(mysql, "SELECT a FROM t1");
        check_mysql_rc(rc, mysql);
       
        if (!(res= mysql_store_result(mysql)))
        {
          diag("Error: %s", mysql_error(mysql));
          return FAIL;
        }
       
        row= mysql_fetch_row(res);
        FAIL_IF(strlen(row[0]) != 1024 * 1024 * 20, "Wrong length");
        mysql_free_result(res);
       
        rc= mysql_query(my, "SET GLOBAL max_allowed_packet=@save");
        check_mysql_rc(rc, my);
        return OK;
      }

      Attachments

        Activity

          People

            georg Georg Richter
            georg Georg Richter
            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.