~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to tests/mysql_client_test.c

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13445
13445
             ")";
13446
13446
  rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
13447
13447
  myquery(rc);
13448
 
  stmt_text= "insert into t1 VALUES ("
 
13448
 
 
13449
  {
 
13450
    const char insert_text[]= 
 
13451
             "insert into t1 VALUES ("
13449
13452
             "-10, "                            /* i8 */
13450
13453
             "200, "                            /* ui8 */
13451
13454
             "32000, "                          /* i16 */
13461
13464
             "'12345.67               ', "      /* tx_1 */
13462
13465
             "'12345.67abc'"                    /* ch_2 */
13463
13466
             ")";
13464
 
  rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
13465
 
  myquery(rc);
 
13467
    rc= mysql_real_query(mysql, insert_text, strlen(insert_text));
 
13468
    myquery(rc);
 
13469
  }
13466
13470
 
13467
13471
  stmt_text= "select i8 c1, i8 c2, ui8 c3, i16_1 c4, ui16 c5, "
13468
13472
             "       i16 c6, ui16 c7, i32 c8, i32_1 c9, i32_1 c10, "
19689
19693
 
19690
19694
 
19691
19695
/*
 
19696
  Bug#13001491: MYSQL_REFRESH CRASHES WHEN STORED ROUTINES ARE RUN CONCURRENTLY.
 
19697
*/
 
19698
static void test_bug13001491()
 
19699
{
 
19700
  int rc;
 
19701
  char query[MAX_TEST_QUERY_LENGTH];
 
19702
  MYSQL *c;
 
19703
 
 
19704
  myheader("test_bug13001491");
 
19705
 
 
19706
  my_snprintf(query, MAX_TEST_QUERY_LENGTH,
 
19707
           "GRANT ALL PRIVILEGES ON *.* TO mysqltest_u1@%s",
 
19708
           opt_host ? opt_host : "'localhost'");
 
19709
           
 
19710
  rc= mysql_query(mysql, query);
 
19711
  myquery(rc);
 
19712
 
 
19713
  my_snprintf(query, MAX_TEST_QUERY_LENGTH,
 
19714
           "GRANT RELOAD ON *.* TO mysqltest_u1@%s",
 
19715
           opt_host ? opt_host : "'localhost'");
 
19716
           
 
19717
  rc= mysql_query(mysql, query);
 
19718
  myquery(rc);
 
19719
 
 
19720
  c= mysql_client_init(NULL);
 
19721
 
 
19722
  DIE_UNLESS(mysql_real_connect(c, opt_host, "mysqltest_u1", NULL,
 
19723
                                current_db, opt_port, opt_unix_socket,
 
19724
                                CLIENT_MULTI_STATEMENTS |
 
19725
                                CLIENT_MULTI_RESULTS));
 
19726
 
 
19727
  rc= mysql_query(c, "DROP PROCEDURE IF EXISTS p1");
 
19728
  myquery(rc);
 
19729
 
 
19730
  rc= mysql_query(c,
 
19731
    "CREATE PROCEDURE p1() "
 
19732
    "BEGIN "
 
19733
    " DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; "
 
19734
    " SELECT COUNT(*) "
 
19735
    " FROM INFORMATION_SCHEMA.PROCESSLIST "
 
19736
    " GROUP BY user "
 
19737
    " ORDER BY NULL "
 
19738
    " INTO @a; "
 
19739
    "END");
 
19740
  myquery(rc);
 
19741
 
 
19742
  rc= mysql_query(c, "CALL p1()");
 
19743
  myquery(rc);
 
19744
 
 
19745
  mysql_free_result(mysql_store_result(c));
 
19746
 
 
19747
  /* Check that mysql_refresh() succeeds without REFRESH_LOG. */
 
19748
  rc= mysql_refresh(c, REFRESH_GRANT |
 
19749
                       REFRESH_TABLES | REFRESH_HOSTS |
 
19750
                       REFRESH_STATUS | REFRESH_THREADS);
 
19751
  myquery(rc);
 
19752
 
 
19753
  /*
 
19754
    Check that mysql_refresh(REFRESH_LOG) does not crash the server even if it
 
19755
    fails. mysql_refresh(REFRESH_LOG) fails when error log points to unavailable
 
19756
    location.
 
19757
  */
 
19758
  mysql_refresh(c, REFRESH_LOG);
 
19759
 
 
19760
  rc= mysql_query(c, "DROP PROCEDURE p1");
 
19761
  myquery(rc);
 
19762
 
 
19763
  mysql_close(c);
 
19764
  c= NULL;
 
19765
 
 
19766
  my_snprintf(query, MAX_TEST_QUERY_LENGTH,
 
19767
           "DROP USER mysqltest_u1@%s",
 
19768
           opt_host ? opt_host : "'localhost'");
 
19769
           
 
19770
  rc= mysql_query(mysql, query);
 
19771
  myquery(rc);
 
19772
}
 
19773
 
 
19774
 
 
19775
/*
19692
19776
  Read and parse arguments and MySQL options from my.cnf
19693
19777
*/
19694
19778
 
20034
20118
  { "test_bug11766854", test_bug11766854 },
20035
20119
  { "test_bug12337762", test_bug12337762 },
20036
20120
  { "test_bug11754979", test_bug11754979 },
 
20121
  { "test_bug13001491", test_bug13001491 },
20037
20122
  { 0, 0 }
20038
20123
};
20039
20124