Commit Graph

390 Commits

Author SHA1 Message Date
Raul Marin
10ed64789d Add functions to grant and revoke permissions over federated servers 2019-11-04 19:23:36 +01:00
Raul Marin
03bc3436cd Add more tests for [un-]registering servers 2019-11-04 16:29:18 +01:00
Raul Marin
57f420ab4c CDB_FederatedServerListRemote: Add rainy tests 2019-11-04 15:32:34 +01:00
Raul Marin
c740cfa499 CDB_Federated_Server_List_Remote_Columns: Return also type name 2019-11-04 15:18:46 +01:00
Raul Marin
eea0198864 Add CDB_Federated_Server_List_Remote_Columns 2019-10-31 15:29:37 +01:00
Raul Marin
f75756138a CDB_FederatedServerTables: Avoid decimal mismatch 2019-10-30 15:21:00 +01:00
Raul Marin
28376ffecb CDB_Federated_Table_Register works to refresh a table 2019-10-30 13:53:56 +01:00
Raul Marin
b839235801 Add CDB_Federated_Server_List_Registered_Tables 2019-10-30 12:19:30 +01:00
Raul Marin
d5f84784f0 Add CDB_Federated_Table_Unregister 2019-10-30 11:55:02 +01:00
Raul Marin
7bb0b93f8b Test renaming 2019-10-30 11:47:45 +01:00
Raul Marin
a26b96347a Initial implementation of CDB_Federated_Table_Register 2019-10-30 11:40:35 +01:00
Raul Marin
b76b754811 CDB_FederatedServerTables skeleton 2019-10-29 18:53:05 +01:00
Raul Marin
664468b1e5 Rename CDB_FederatedServerListRemote files 2019-10-29 18:51:47 +01:00
Raul Marin
f7ab3d28a8 __CDB_FS_List_Foreign_Schemas_PG: Handle order and ignore pg_% schemas automatically 2019-10-29 18:35:02 +01:00
Raul Marin
144c4e722b Add federated server list remotes
Includes:
- CDB_Federated_Server_List_Remote_Schemas
- CDB_Federated_Server_List_Remote_Tables
2019-10-29 18:26:52 +01:00
Raul Marin
e22aaee5f5 Test re-registration of a server with different options 2019-10-29 16:47:35 +01:00
Raul Marin
1375894e99 CDB_Federated_Server_Unregister: Better error handling 2019-10-29 12:27:07 +01:00
Raul Marin
f285c806fc Remove error context 2019-10-29 11:57:24 +01:00
Raul Marin
acf1f2dbd4 WIP: Add CDB_Federated_Server_Unregister 2019-10-28 18:34:46 +01:00
Raul Marin
eb02ca4d86 Regress: Allow variables in the tests 2019-10-28 17:12:38 +01:00
Raul Marin
b475eb4356 Federated Server List 2019-10-28 17:10:53 +01:00
Raul Marin
87dec4dbe4 Update README 2019-10-28 16:14:45 +01:00
Gonzalo Riestra
f2e8d029eb check error message 2019-10-25 12:39:30 +02:00
Gonzalo Riestra
036127af9c add schema to function calls 2019-10-25 12:26:21 +02:00
Gonzalo Riestra
a8966270bd add test expect 2019-10-25 11:50:03 +02:00
Gonzalo Riestra
11b30c8f59 fix oauth reassign ownership for functions 2019-10-25 11:34:59 +02:00
Raul Marin
1dcc23db15 CDB_UserTablesTest: Make tests work even if the user doesn't have cartodb in the searchpath 2019-10-24 13:45:36 +02:00
Raul Marin
164fba197f test_foreign_tables: Better debugging and query the default database when needed 2019-10-24 12:35:46 +02:00
Raul Marin
7f9a748119 Make CDB_OAuth independent of the PG version 2019-10-24 12:35:46 +02:00
Raul Marin
409b067721 Quota: Remove kb error from regress tests 2019-10-24 11:15:15 +02:00
Raul Marin
021c7318a3 Adapt QuotaTest to avoid randoms 2019-10-23 16:49:57 +02:00
Raul Marin
a4bcf4c78f Update error messages 2019-10-22 20:13:38 +02:00
Raul Marin
aed88fd958 Force all PG12 to use plpython3u 2019-10-22 15:29:45 +02:00
Raul Marin
5a12033609 Adapt tests to changes 2019-10-03 18:58:27 +02:00
Rafa de la Torre
f9bd469ea9 Make oauth tests a bit more robust 2019-07-17 09:46:49 +02:00
Rafa de la Torre
402d97daa6 Merge remote-tracking branch 'origin/master' into user-defined-fdw 2019-07-17 09:18:35 +02:00
Rafa de la Torre
e41d2ec019 Add a flag to force drop of user FDW and related objects
If force = true then it will add the subclause `CASCADE` to the SQL
DDL sentences that support it, otherwise it'll use `RESTRICT` which is
the default and exact opposite.
2019-07-16 17:40:05 +02:00
Rafa de la Torre
076207c49c Make sure there are no (double)escaping issues 2019-07-16 16:24:02 +02:00
Rafa de la Torre
ce1e9ac41c Prefix all objects created with cdb_fdw_
Build the DB objects related to a user FDW with the following form:
`cdb_fdw_name`. This is aimed at easily inspect and filter them.

As requested in code review.
2019-07-16 15:35:35 +02:00
Rafa de la Torre
0f33ee8b22 Prepend an underscore (_) to functions meant to be run by superuser
_CDB_SetUp_User_PG_FDW_Server and _CDB_Drop_User_PG_FDW_Server are
meant to be executed by a superuser. Therefore they shouldn't be
considered part of the public API and hence the _CDB_Private_Function
naming convention.
2019-07-16 14:32:32 +02:00
Rafa de la Torre
a32dea0282 Remove SECURITY DEFINER from user-defined FDW's 2019-07-16 13:26:03 +02:00
Rafa de la Torre
3a255df9d0 Rename PG-FDW's-specific functions to _PG_FDW_
As per review comment.
2019-07-16 13:14:11 +02:00
Rafa de la Torre
c4e2549dc8 A few more permissions tests for completeness 2019-07-15 18:14:23 +02:00
Rafa de la Torre
2e9f642378 Check when users shall not have permissions to the FDW 2019-07-15 17:32:48 +02:00
Rafa de la Torre
99096d41e0 Drop the role when dropping a user-defined FDW 2019-07-15 17:25:48 +02:00
Rafa de la Torre
3a10ef7e76 Add ability to grant fdw role to org members 2019-07-15 16:54:23 +02:00
Rafa de la Torre
a20676f391 Add a test/example of granting the fdw role 2019-07-15 16:19:06 +02:00
Rafa de la Torre
37004db047 Add new function to drop a user-defined foreign server 2019-07-15 16:14:07 +02:00
Rafa de la Torre
8cfc8e65cf Test with a regular user (non-superadmin) 2019-07-15 14:44:21 +02:00
Rafa de la Torre
6e34e16b8d Add basic test for user-defined FDW's 2019-07-15 13:16:14 +02:00
Mario de Frutos Dieguez
91c3b86d45
Updated NEWS and tests README 2019-07-04 17:53:11 +02:00
Mario de Frutos Dieguez
f55d789c41
Make some tests to have different expects for different PG versions 2019-07-04 17:48:01 +02:00
Mario de Frutos Dieguez
3eb8ab24d8
Improved tests 2019-07-04 17:48:01 +02:00
Mario de Frutos Dieguez
f4be59cae0
Added tests 2019-07-04 17:48:00 +02:00
Javier Goizueta
bf140890d8
Merge pull request #365 from CartoDB/table-syncer-notmps
Sync tables without using temporary hash tables
2019-07-04 16:05:21 +02:00
Rafa de la Torre
29a31d4c40
Merge pull request #362 from CartoDB/fdw-affected-tables
Make CDB_Get_Foreign_Updated_At robust to missing CDB_TableMetadata
2019-07-04 16:02:46 +02:00
Javier Goizueta
cb353ec6a8 Add tests for quoted table & column names 2019-07-04 12:47:01 +02:00
Javier Goizueta
2beabfced6 Add test for double schema-quoting 2019-07-03 18:48:49 +02:00
Rafa de la Torre
d378ca6fe0 Test for missing foreign CDB_TableMetadata 2019-07-03 16:25:16 +02:00
Javier Goizueta
4651883454 Fix order of test results 2019-07-02 17:43:13 +02:00
Rafa de la Torre
b0b4a92240 Add a test case for missing foreign CDB_Tablementadata 2019-06-28 16:19:57 +02:00
Javier Goizueta
b5f36902c5 Merge branch 'master' into table-syncer 2019-06-28 13:50:46 +02:00
Raul Marin
010cbe6e18 Remove unnecessary changes 2019-05-31 15:52:55 +02:00
Raul Marin
06f563bb73 Tests: Only create publicuser if necessary
Also, don't try to drop it since it's used by default
CARTO installation
2019-05-31 15:37:15 +02:00
Raul Marin
78077a6ec1 Bash tests improvements
- Stop loading sql files manually.
- Make tests independent.
- Single DB setup (not once per test)
2019-05-31 15:37:15 +02:00
Rafa de la Torre
a2723a3c90 Exclude certain columns from sync if instructed to do so
For the Geocoding (and in general for LDS use cases) it may come in
handy to exclude geometry columns from the list of stuff to
syncrhonize. Otherwise they may be lost, overwritten with NULL values.
2019-05-28 16:11:56 +02:00
Rafa de la Torre
45c21d7f42 Make other tests resilient to CDB_SyncTable test failures
Use a transaction to avoid leaving stuff after our tests, that affect
Quota and User Tables tests.
2019-05-28 15:33:55 +02:00
Rafa de la Torre
f442c21fa4 Fix the test/CDB_AnalysisCheckTest.sql
These tests are failing in PG11:

```
*** /home/travis/build/CartoDB/cartodb-postgresql/expected/test/CDB_AnalysisCheckTest.out	2019-05-27 16:09:45.063543994 +0000
--- /home/travis/build/CartoDB/cartodb-postgresql/results/test/CDB_AnalysisCheckTest.out	2019-05-27 16:12:39.770847666 +0000
***************
*** 5,12 ****
  CREATE TABLE
  CREATE TABLE
  CREATE TABLE
- (analysis_2f13a3dbd7_41bd92976fc6dd97072afe4ee450054f4c0715d5,public,analysis_2f13a3dbd7_41bd92976fc6dd97072afe4ee450054f4c0715d5)
  (analysis_2f13a3dbd7_f00cee44e9e6152b450bde3a92eb9ae0d099da94,public,analysis_2f13a3dbd7_f00cee44e9e6152b450bde3a92eb9ae0d099da94)
  0

  1
--- 5,12 ----
  CREATE TABLE
  CREATE TABLE
  CREATE TABLE
  (analysis_2f13a3dbd7_f00cee44e9e6152b450bde3a92eb9ae0d099da94,public,analysis_2f13a3dbd7_f00cee44e9e6152b450bde3a92eb9ae0d099da94)
+ (analysis_2f13a3dbd7_41bd92976fc6dd97072afe4ee450054f4c0715d5,public,analysis_2f13a3dbd7_41bd92976fc6dd97072afe4ee450054f4c0715d5)
  0

  1
```

The reason for that is that they rely on row ordering that cannot be
guaranteed as per SQL Standard. Forcing that assumed ordering is
enough to get it working again.
2019-05-28 09:34:10 +02:00
Rafa de la Torre
ee9d08a2be Some functional E2E tests for the CDB_SyncTable() function 2019-05-27 17:56:36 +02:00
Gonzalo Riestra
5b19d0fc5e fix test correctly 2019-03-14 12:08:33 +01:00
Gonzalo Riestra
2baee24f30 fix test 2019-03-14 11:47:41 +01:00
Gonzalo Riestra
a5b2b66bb6 fix test comment 2019-03-14 10:06:04 +01:00
Gonzalo Riestra
3faa389860 improve logs 2019-03-13 18:16:08 +01:00
Gonzalo Riestra
bc5d532735 remove default TIS config 2019-03-13 18:12:48 +01:00
Gonzalo Riestra
65d51fd8bd move cdb_ddl_execution table creation/drop to functions 2019-03-11 14:02:45 +01:00
Gonzalo Riestra
a794fb3d31 read tis config from cdb_conf 2019-03-08 12:03:55 +01:00
Gonzalo Riestra
50e41179fc fix test 2019-03-08 09:18:46 +01:00
Gonzalo Riestra
5f154a5859 use TIS instead of Redis 2019-03-08 08:28:06 +01:00
Gonzalo Riestra
99dd7cefc7 ghost tables functions using redis 2019-03-06 18:20:04 +01:00
Gonzalo Riestra
0568b36a90 use session_user instead of current_user 2019-02-20 14:45:57 +01:00
Gonzalo Riestra
6d122462bb decouple tests from cartodb 2019-02-20 13:34:11 +01:00
Gonzalo Riestra
2a4ecd4850 Add CDB_Username() function 2019-02-20 10:38:00 +01:00
Raul Marin
7e131ac88d Jenks: Add test for less data than breaks 2018-09-10 16:15:02 +02:00
Raul Marin
272d5be776 Jenks: Add inverse request test 2018-09-10 15:42:54 +02:00
Raul Marin
fcc06e82bf Jenks: Force valid tests 2018-09-10 13:16:25 +02:00
Raul Marin
74f939fd53 CDB_OverviewsTest: Run analyze for consistency 2018-09-04 18:22:22 +02:00
Raul Marin
ac15a6da25 Test: Update CDB_GreatCircle_expect for Postgis 2.4 2018-09-04 17:25:22 +02:00
Eneko Lakasta
b209726b1c
Merge pull request #320 from bloomberg/v0_18_5/cdb_tablemetadata_text_hotfix
Fix incorrect timestamps in CDB_TableMetadata_Text
2018-07-23 16:00:19 +02:00
Javier Torres
24a37be1a9 Change querytables expect test 2018-07-20 13:22:02 +02:00
Javier Torres
5659275c0c Don't rely on regexp to identify non explainable queries 2018-07-20 13:01:51 +02:00
Rafa de la Torre
55a77b0ef0 Add a new helper function _CDB_Table_Exists 2018-07-03 13:00:24 +02:00
Javier Torres
c19c88c9e0 Test for granting permissions for table with non-seria lcartodb_id 2018-05-28 19:54:19 +02:00
Javier Torres
716f47edae We should be able to grant permission to non-cartodbfied tables 2018-05-28 19:46:58 +02:00
Mario de Frutos
da5d3ea8d9
Added test for the case that arose in #325 2018-03-22 11:53:50 +01:00
Andy Eschbacher
b6b0ef704a Merge branch 'master' into quantiles-bins-updates 2018-03-08 10:33:01 -05:00
Javier Goizueta
0a58c05049
Merge pull request #323 from CartoDB/321-grant-sequence
grant usage on cartodb_id sequence when sharing read write
2018-02-15 16:29:25 +01:00
Javier Goizueta
0a0f2e294b Fix tests 2018-02-15 10:27:19 +01:00
Alberto Romeu
cd4653ecc0 grant usage on cartodb_id sequence when sharing read write 2018-02-15 08:40:17 +01:00
Javier Goizueta
7ea428913a Add limit to the grid-generating functions
This adds an optinal maxcells parameter to the rectangle and hexagonal grids,
with a default value of 262144 (2^18).
An error occurs when the grids would need more cells.
2018-02-14 17:50:06 +01:00
Tyler Parsons
5c86029029 Test for correct timestamps in cdb_tablemetadata_text 2018-01-25 23:08:28 -05:00