Compare commits

...

5 Commits

@ -1,3 +1,6 @@
3.11.1 (2015-09-11)
-------------------
* Fix crash in ghost tables linking when user has table names with capitals or characters needing quoting [#5474](https://github.com/CartoDB/cartodb/pull/5474)
3.11.0 (2015-09-09)
-------------------

@ -1217,7 +1217,7 @@ class User < Sequel::Model
sql += %Q{
column_name IN (#{cartodb_columns}) AND
tg.tgrelid = (t.schemaname || '.' || t.tablename)::regclass::oid AND
tg.tgrelid = (quote_ident(t.schemaname) || '.' || quote_ident(t.tablename))::regclass::oid AND
tg.tgname = 'test_quota_per_row'
GROUP BY 1
@ -2121,7 +2121,7 @@ TRIGGER
# Upgrade the cartodb postgresql extension
def upgrade_cartodb_postgres_extension(statement_timeout=nil, cdb_extension_target_version=nil)
if cdb_extension_target_version.nil?
cdb_extension_target_version = '0.10.0'
cdb_extension_target_version = '0.10.2'
end
in_database({

@ -1 +1 @@
Subproject commit c6f29032211c74958eb151dcdde256fc66c24a4a
Subproject commit 7d106e68b0e65ed6c53b2a57e295157acb8378bf

@ -1225,6 +1225,27 @@ describe User do
@user.tables.where(name: table.name).first.should be_nil
end
it "should link a table that requires quoting, e.g: name with capitals" do
initial_count = @user.tables.count
@user.in_database.run %Q{CREATE TABLE "MyTableWithCapitals" (cartodb_id integer, the_geom geometry, the_geom_webmercator geometry)}
@user.in_database.run(%Q{
CREATE OR REPLACE FUNCTION test_quota_per_row()
RETURNS trigger
AS $$
BEGIN
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
})
@user.in_database.run %Q{CREATE TRIGGER test_quota_per_row BEFORE INSERT ON "MyTableWithCapitals" EXECUTE PROCEDURE test_quota_per_row()}
@user.link_ghost_tables
# TODO: the table won't be cartodbfy'ed and registered until we support CamelCase identifiers.
@user.tables.count.should == initial_count
end
end
describe '#shared_tables' do

Loading…
Cancel
Save