~jbaker/storm/nose_plugin

« back to all changes in this revision

Viewing changes to tests/databases/mysql.py

  • Committer: Jamu Kakar
  • Date: 2009-10-23 19:19:16 UTC
  • mfrom: (329.3.1 mysql-reserved-words)
  • Revision ID: jkakar@kakar.ca-20091023191916-6jfp30ed3l2bl1se
Merged mysql-reserved-words [r=gabriel,jamesh] [f=433833]

MySQL reserved words that weren't treated properly before are
handled correctly now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        result = self.connection.execute("SELECT MAX(id) FROM test")
107
107
        self.assertEqual(result.get_one()[0], id_variable.get())
108
108
 
 
109
    def test_mysql_specific_reserved_words(self):
 
110
        reserved_words = """
 
111
            accessible analyze asensitive before bigint binary blob call
 
112
            change condition current_user database databases day_hour
 
113
            day_microsecond day_minute day_second delayed deterministic
 
114
            distinctrow div dual each elseif enclosed escaped exit explain
 
115
            float4 float8 force fulltext high_priority hour_microsecond
 
116
            hour_minute hour_second if ignore index infile inout int1 int2
 
117
            int3 int4 int8 iterate keys kill leave limit linear lines load
 
118
            localtime localtimestamp lock long longblob longtext loop
 
119
            low_priority master_ssl_verify_server_cert mediumblob mediumint
 
120
            mediumtext middleint minute_microsecond minute_second mod modifies
 
121
            no_write_to_binlog optimize optionally out outfile purge range
 
122
            read_write reads regexp release rename repeat replace require
 
123
            return rlike schemas second_microsecond sensitive separator show
 
124
            spatial specific sql_big_result sql_calc_found_rows
 
125
            sql_small_result sqlexception sqlwarning ssl starting
 
126
            straight_join terminated tinyblob tinyint tinytext trigger undo
 
127
            unlock unsigned use utc_date utc_time utc_timestamp varbinary
 
128
            varcharacter while xor year_month zerofill
 
129
            """.split()
 
130
        for word in reserved_words:
 
131
            self.assertTrue(self.connection.compile.is_reserved_word(word),
 
132
                            "Word missing: %s" % (word,))
 
133
 
109
134
 
110
135
class MySQLUnsupportedTest(UnsupportedDatabaseTest, TestHelper):
111
 
    
 
136
 
112
137
    dbapi_module_names = ["MySQLdb"]
113
138
    db_module_name = "mysql"
114
139