~ubuntu-branches/ubuntu/oneiric/mysql-connector-java/oneiric

« back to all changes in this revision

Viewing changes to src/testsuite/regression/EscapeProcessorRegressionTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Marcus Better
  • Date: 2006-12-29 13:29:04 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20061229132904-uj7edcmwgtuxh6li
Tags: 5.0.4+dfsg-2
Corrected the symlink `/usr/share/java/mysql.jar'. Thanks to Javier
Kohen. (Closes: #404858)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 */
23
23
package testsuite.regression;
24
24
 
25
 
import testsuite.BaseTestCase;;
 
25
import testsuite.BaseTestCase;
26
26
 
27
27
/**
28
28
 * Tests regressions w/ the Escape Processor code.
29
29
 * 
30
30
 * @version $Id:$
31
 
 *
 
31
 * 
32
32
 */
33
33
public class EscapeProcessorRegressionTest extends BaseTestCase {
34
34
 
46
46
        }
47
47
 
48
48
        /**
49
 
         * Tests fix for BUG#11797 - Escape tokenizer doesn't respect stacked single quotes
50
 
         * for escapes.
 
49
         * Tests fix for BUG#11797 - Escape tokenizer doesn't respect stacked single
 
50
         * quotes for escapes.
51
51
         * 
52
 
         * @throws Exception if the test fails.
 
52
         * @throws Exception
 
53
         *             if the test fails.
53
54
         */
54
55
        public void testBug11797() throws Exception {
55
 
                assertEquals("select 'ESCAPED BY ''\\'' ON {tbl_name | * | *.* | db_name.*}'", 
56
 
                                this.conn.nativeSQL("select 'ESCAPED BY ''\\'' ON {tbl_name | * | *.* | db_name.*}'"));
 
56
                assertEquals(
 
57
                                "select 'ESCAPED BY ''\\'' ON {tbl_name | * | *.* | db_name.*}'",
 
58
                                this.conn
 
59
                                                .nativeSQL("select 'ESCAPED BY ''\\'' ON {tbl_name | * | *.* | db_name.*}'"));
57
60
        }
58
 
        
 
61
 
59
62
        /**
60
 
         * Tests fix for BUG#11498 - Escape processor didn't honor strings demarcated
61
 
         * with double quotes.
 
63
         * Tests fix for BUG#11498 - Escape processor didn't honor strings
 
64
         * demarcated with double quotes.
62
65
         * 
63
 
         * @throws Exception if the test fails.
 
66
         * @throws Exception
 
67
         *             if the test fails.
64
68
         */
65
69
        public void testBug11498() throws Exception {
66
 
                assertEquals("replace into t1 (id, f1, f4) VALUES(1,\"\",\"tko { zna gdje se sakrio\"),(2,\"a\",\"sedmi { kontinentio\"),(3,\"a\",\"a } cigov si ti?\")",
67
 
                                this.conn.nativeSQL("replace into t1 (id, f1, f4) VALUES(1,\"\",\"tko { zna gdje se sakrio\"),(2,\"a\",\"sedmi { kontinentio\"),(3,\"a\",\"a } cigov si ti?\")"));
68
 
                
 
70
                assertEquals(
 
71
                                "replace into t1 (id, f1, f4) VALUES(1,\"\",\"tko { zna gdje se sakrio\"),(2,\"a\",\"sedmi { kontinentio\"),(3,\"a\",\"a } cigov si ti?\")",
 
72
                                this.conn
 
73
                                                .nativeSQL("replace into t1 (id, f1, f4) VALUES(1,\"\",\"tko { zna gdje se sakrio\"),(2,\"a\",\"sedmi { kontinentio\"),(3,\"a\",\"a } cigov si ti?\")"));
 
74
 
 
75
        }
 
76
 
 
77
        /**
 
78
         * Tests fix for BUG#14909 - escape processor replaces quote character in
 
79
         * quoted string with string delimiter.
 
80
         * 
 
81
         * @throws Exception
 
82
         */
 
83
        public void testBug14909() throws Exception {
 
84
                assertEquals("select '{\"','}'", this.conn
 
85
                                .nativeSQL("select '{\"','}'"));
69
86
        }
70
87
}