From 9fd86eb6c92c3ec29e786058d2f8db5b310a2787 Mon Sep 17 00:00:00 2001 From: Akash Thawait Date: Thu, 26 Dec 2024 19:06:12 +0530 Subject: [PATCH] Rebased with the master branch --- sources/mysql/infoschema_test.go | 14 +++++++------- ui/src/app/services/fetch/fetch.service.ts | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sources/mysql/infoschema_test.go b/sources/mysql/infoschema_test.go index dace89a9a..a3452e91c 100644 --- a/sources/mysql/infoschema_test.go +++ b/sources/mysql/infoschema_test.go @@ -56,7 +56,7 @@ func TestProcessSchemaMYSQL(t *testing.T) { }, }, { - query: `SELECT COUNT\(\*\) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' AND TABLE_NAME = 'CHECK_CONSTRAINTS';`, + query: regexp.QuoteMeta(`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'information_schema' OR TABLE_SCHEMA = 'INFORMATION_SCHEMA') AND TABLE_NAME = 'CHECK_CONSTRAINTS';`), args: nil, cols: []string{"count"}, rows: [][]driver.Value{ @@ -96,7 +96,7 @@ func TestProcessSchemaMYSQL(t *testing.T) { cols: []string{"INDEX_NAME", "COLUMN_NAME", "SEQ_IN_INDEX", "COLLATION", "NON_UNIQUE"}, }, { - query: `SELECT COUNT\(\*\) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' AND TABLE_NAME = 'CHECK_CONSTRAINTS';`, + query: regexp.QuoteMeta(`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'information_schema' OR TABLE_SCHEMA = 'INFORMATION_SCHEMA') AND TABLE_NAME = 'CHECK_CONSTRAINTS';`), args: nil, cols: []string{"count"}, rows: [][]driver.Value{ @@ -145,7 +145,7 @@ func TestProcessSchemaMYSQL(t *testing.T) { }, }, { - query: `SELECT COUNT\(\*\) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' AND TABLE_NAME = 'CHECK_CONSTRAINTS';`, + query: regexp.QuoteMeta(`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'information_schema' OR TABLE_SCHEMA = 'INFORMATION_SCHEMA') AND TABLE_NAME = 'CHECK_CONSTRAINTS';`), args: nil, cols: []string{"count"}, rows: [][]driver.Value{ @@ -181,7 +181,7 @@ func TestProcessSchemaMYSQL(t *testing.T) { cols: []string{"INDEX_NAME", "COLUMN_NAME", "SEQ_IN_INDEX", "COLLATION", "NON_UNIQUE"}, }, { - query: `SELECT COUNT\(\*\) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' AND TABLE_NAME = 'CHECK_CONSTRAINTS';`, + query: regexp.QuoteMeta(`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'information_schema' OR TABLE_SCHEMA = 'INFORMATION_SCHEMA') AND TABLE_NAME = 'CHECK_CONSTRAINTS';`), args: nil, cols: []string{"count"}, rows: [][]driver.Value{ @@ -237,7 +237,7 @@ func TestProcessSchemaMYSQL(t *testing.T) { cols: []string{"INDEX_NAME", "COLUMN_NAME", "SEQ_IN_INDEX", "COLLATION", "NON_UNIQUE"}, }, { - query: `SELECT COUNT\(\*\) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' AND TABLE_NAME = 'CHECK_CONSTRAINTS';`, + query: regexp.QuoteMeta(`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'information_schema' OR TABLE_SCHEMA = 'INFORMATION_SCHEMA') AND TABLE_NAME = 'CHECK_CONSTRAINTS';`), args: nil, cols: []string{"count"}, rows: [][]driver.Value{ @@ -418,7 +418,7 @@ func TestProcessData_MultiCol(t *testing.T) { rows: [][]driver.Value{{"test"}}, }, { - query: `SELECT COUNT\(\*\) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' AND TABLE_NAME = 'CHECK_CONSTRAINTS';`, + query: regexp.QuoteMeta(`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'information_schema' OR TABLE_SCHEMA = 'INFORMATION_SCHEMA') AND TABLE_NAME = 'CHECK_CONSTRAINTS';`), args: nil, cols: []string{"count"}, rows: [][]driver.Value{ @@ -530,7 +530,7 @@ func TestProcessSchema_Sharded(t *testing.T) { rows: [][]driver.Value{{"test"}}, }, { - query: `SELECT COUNT\(\*\) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' AND TABLE_NAME = 'CHECK_CONSTRAINTS';`, + query: regexp.QuoteMeta(`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'information_schema' OR TABLE_SCHEMA = 'INFORMATION_SCHEMA') AND TABLE_NAME = 'CHECK_CONSTRAINTS';`), args: nil, cols: []string{"count"}, rows: [][]driver.Value{ diff --git a/ui/src/app/services/fetch/fetch.service.ts b/ui/src/app/services/fetch/fetch.service.ts index 67bf55f7c..7045f3d85 100644 --- a/ui/src/app/services/fetch/fetch.service.ts +++ b/ui/src/app/services/fetch/fetch.service.ts @@ -25,8 +25,7 @@ import ICreateSequence from 'src/app/model/auto-gen' providedIn: 'root', }) export class FetchService { - // private url: string = window.location.origin - private url: string = 'http://localhost:8080' + private url: string = window.location.origin constructor(private http: HttpClient) {} connectTodb(payload: IDbConfig, dialect: string) {