{"issue":{"created_at":"2011-08-01T21:25:30Z","state":"open","updated_at":"2011-12-13T07:53:18Z","comments":2,"user":{"gravatar_id":"cf4bcfb8a667d31638189351f90e9bd5","id":908592,"url":"https://api.github.com/users/pelizza","login":"pelizza","avatar_url":"https://secure.gravatar.com/avatar/cf4bcfb8a667d31638189351f90e9bd5?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"In our current application we have a master wich is a PostgreSQL database and two shards wich are on Ms SQLServer. The problem we are facing is that the PostgreSQL syntax is being used on the queries performed on the shards.\r\n\r\nWe confirmed this behavior by setting the master as one a SQL Server too.\r\n\r\nHere is the query performed on a shard (SQLServer database) generated when a PostgreSQL adapter is master:\r\nSELECT [FASE2].* FROM [FASE2] JOIN fase2_enviar ON fase2.id = fase2_enviar.id LIMIT 50\r\n\r\nAnd here is the 'correct' query when all adapters are SQLServer:\r\nSELECT TOP(50) [FASE2].* FROM [FASE2] JOIN fase2_enviar ON fase2.id = fase2_enviar.id","assignee":null,"id":1326038,"labels":[],"number":48,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Master SQL syntax is used on all shards","closed_at":null,"html_url":"https://github.com/tchandy/octopus/issues/48","url":"https://api.github.com/repos/tchandy/octopus/issues/48","milestone":null},"action":"created","comment":{"created_at":"2011-12-13T07:53:18Z","updated_at":"2011-12-13T07:53:18Z","user":{"gravatar_id":"24f40160c2c3626054cdf9a0379539bf","id":124715,"url":"https://api.github.com/users/thms","login":"thms","avatar_url":"https://secure.gravatar.com/avatar/24f40160c2c3626054cdf9a0379539bf?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I have a similar / exactly the same issue: My master DB is  MySQL, and I am trying to use shards to connect to a number of MS SQL servers (legacy environments) via tiny-tds.\r\nI see the same behaviour. Queries that use LIMIT in MySQL and should use TOP N for Microsoft use the wrong syntax. ","id":3120017,"url":"https://api.github.com/repos/tchandy/octopus/issues/comments/3120017"}}