meteor-mysql
meteor-mysql copied to clipboard
Capitalised table names in `subscribe` are not reactive
Somehow, capitalised table names cause the items to only be refreshed when the page is reloaded.
For the leaderboard example, if I change the table name in leaderboard.sql
, from players
to Players
, and the table
parameter from players
to Players
, the changes will only show up when the page is refreshed.
However, I've noticed that even if the table name is Players
, I can still use players
as the table
parameter, and the page still appears to be reactive.
I'm not entirely sure what the cause of this is, maybe you can shed some light on this bug?
Something to note is that I'm on OSX 10.11, I've a friend who doesn't seem to encounter this problem on Ubuntu.
To reproduce the bug, change
For leaderboard.sql
CREATE DATABASE `leaderboard`;
USE `leaderboard`;
CREATE TABLE `Players` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`score` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `Players` (`name`, `score`) VALUES
('Kepler', 40),('Leibniz',50),('Maxwell',60),('Planck',70);
Within leaderboard.js
Meteor.publish('allPlayers', function () {
return liveDb.select(
'SELECT * FROM Players',
[{table: 'Players'}]
);
});