Primary Key and Index error when selecting data
(self)
| 72 | conn.close() |
| 73 | |
| 74 | def test_issue_8(self): |
| 75 | """Primary Key and Index error when selecting data""" |
| 76 | conn = self.connect() |
| 77 | c = conn.cursor() |
| 78 | with warnings.catch_warnings(): |
| 79 | warnings.filterwarnings("ignore") |
| 80 | c.execute("drop table if exists test") |
| 81 | c.execute( |
| 82 | """CREATE TABLE `test` (`station` int NOT NULL DEFAULT '0', `dh` |
| 83 | datetime NOT NULL DEFAULT '2015-01-01 00:00:00', `echeance` int NOT NULL |
| 84 | DEFAULT '0', `me` double DEFAULT NULL, `mo` double DEFAULT NULL, PRIMARY |
| 85 | KEY (`station`,`dh`,`echeance`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;""" |
| 86 | ) |
| 87 | try: |
| 88 | self.assertEqual(0, c.execute("SELECT * FROM test")) |
| 89 | c.execute("ALTER TABLE `test` ADD INDEX `idx_station` (`station`)") |
| 90 | self.assertEqual(0, c.execute("SELECT * FROM test")) |
| 91 | finally: |
| 92 | c.execute("drop table test") |
| 93 | |
| 94 | def test_issue_13(self): |
| 95 | """can't handle large result fields""" |