diff options
author | Anel <an3l@users.noreply.github.com> | 2022-10-16 20:38:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-16 19:38:04 +0100 |
commit | b20f608d4f9a3e77db1381ea6ccaab4ae83c07c2 (patch) | |
tree | 182e9fb630d483deb05c5c17aded2939efe7bdfa | |
parent | 5f25a9114051b078696813628c37add0e15d88f2 (diff) | |
download | mariadb-git-b20f608d4f9a3e77db1381ea6ccaab4ae83c07c2.tar.gz |
Update ODBC instructions for Connect SE and update ODBC result file (#2284)
* ODBC Connect cosmetic fixes
- Update command for connection for default `peer` authentication for user
`postgres` (unless changed in `pg_hba.conf`).
- Update command for privilege to be more verbose.
- Update path for `.sql` file
- Update instructions for `pg_hba.conf` file to use unix socket
(`local`) type as well as TCP/IP type `host`.
- Update instruction about usage of user dsn (data source file) over
system dsn.
- Update path of `odbc-postgresql` driver path in comment
* Connect SE: update ODBC result file
3 files changed, 27 insertions, 22 deletions
diff --git a/storage/connect/mysql-test/connect/r/odbc_postgresql.result b/storage/connect/mysql-test/connect/r/odbc_postgresql.result index fd23197c37f..4a41dcf6ab8 100644 --- a/storage/connect/mysql-test/connect/r/odbc_postgresql.result +++ b/storage/connect/mysql-test/connect/r/odbc_postgresql.result @@ -2,7 +2,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `Name` varchar(256) NOT NULL, `Description` varchar(256) DEFAULT NULL -) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Sources' +) ENGINE=CONNECT DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `TABLE_TYPE`='ODBC' `CATFUNC`='Sources' SET NAMES utf8; # # Checking CATFUNC=Tables @@ -157,7 +157,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(10) NOT NULL -) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' +) ENGINE=CONNECT DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' SELECT * FROM t1; a 10 @@ -168,7 +168,7 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(10) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci SELECT * FROM t2; a 10 @@ -189,7 +189,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(10) NOT NULL -) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='public.t1' +) ENGINE=CONNECT DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='public.t1' SELECT * FROM t1; a 10 @@ -202,7 +202,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(10) NOT NULL -) ENGINE=CONNECT DEFAULT CHARSET=utf8mb3 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.t1' `DATA_CHARSET`='utf8' +) ENGINE=CONNECT DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.t1' `DATA_CHARSET`='utf8' SELECT * FROM t1; a aaa @@ -213,8 +213,8 @@ CREATE TABLE t2 AS SELECT * FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` char(10) CHARACTER SET utf8mb3 NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 + `a` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci SELECT * FROM t2; a aaa @@ -237,7 +237,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL -) ENGINE=CONNECT DEFAULT CHARSET=utf8mb3 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.v1' `DATA_CHARSET`='utf8' +) ENGINE=CONNECT DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.v1' `DATA_CHARSET`='utf8' SELECT * FROM t1; a aaa @@ -248,8 +248,8 @@ CREATE TABLE t2 AS SELECT * FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` char(10) CHARACTER SET utf8mb3 DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 + `a` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci SELECT * FROM t2; a aaa @@ -272,7 +272,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(10) NOT NULL -) ENGINE=CONNECT DEFAULT CHARSET=utf8mb3 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.t2' `DATA_CHARSET`='utf8' +) ENGINE=CONNECT DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.t2' `DATA_CHARSET`='utf8' SELECT * FROM t1; a xxx @@ -283,8 +283,8 @@ CREATE TABLE t2 AS SELECT * FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` char(10) CHARACTER SET utf8mb3 NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 + `a` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci SELECT * FROM t2; a xxx diff --git a/storage/connect/mysql-test/connect/t/odbc_postgresql.sql b/storage/connect/mysql-test/connect/t/odbc_postgresql.sql index a795817a4d3..e6452f70b37 100644 --- a/storage/connect/mysql-test/connect/t/odbc_postgresql.sql +++ b/storage/connect/mysql-test/connect/t/odbc_postgresql.sql @@ -2,7 +2,7 @@ -- The SQL script to create PostgreSQL data for odbc_postgresql.test -- -- Run this script as a admin user: --- psql -U postgres < odbc_postgresql.sql +-- sudo -u postgres psql < storage/connect/mysql-test/connect/t/odbc_postgresql.sql SET NAMES 'UTF8'; @@ -11,7 +11,7 @@ DROP USER IF EXISTS mtr; CREATE USER mtr WITH PASSWORD 'mtr'; CREATE DATABASE mtr OWNER=mtr ENCODING='UTF8'; -GRANT ALL ON DATABASE mtr TO mtr; +GRANT ALL PRIVILEGES ON DATABASE mtr TO mtr; \c mtr SET role mtr; CREATE TABLE t1 (a INT NOT NULL); @@ -27,4 +27,4 @@ CREATE TABLE schema1.t2 (a CHAR(10) NOT NULL); INSERT INTO schema1.t2 VALUES ('xxx'),('yyy'),('zzz'),('ÄÖÜ'); CREATE TABLE schema1.t3 (a CHAR(10) NOT NULL, b CHAR(10) NOT NULL); INSERT INTO schema1.t3 VALUES ('xxx', 'aaa'),('yyy', 'bbb'),('zzz', 'ccc'),('ÄÖÜ', 'яяя'); - +\dt schema1.* diff --git a/storage/connect/mysql-test/connect/t/odbc_postgresql.test b/storage/connect/mysql-test/connect/t/odbc_postgresql.test index 86597423d04..2c3d4040c79 100644 --- a/storage/connect/mysql-test/connect/t/odbc_postgresql.test +++ b/storage/connect/mysql-test/connect/t/odbc_postgresql.test @@ -5,10 +5,10 @@ # To configure your system to be able to run this test, # follow through the following steps: # -# 1. Install and configure PostgreSQL database to stat on the system startup +# 1. Install and configure PostgreSQL database to start on the system startup # # 2. Create user, database, schema and tables to be used by mtr: -# psql -U postgres < odbc_postgresql.sql +# sudo -u postgres psql < storage/connect/mysql-test/connect/t/odbc_postgresql.sql # # 3. Install PostgreSQL ODBC Driver. # - On CentOS, Fedora: @@ -18,18 +18,23 @@ # # 4. Create a data source with the name "ConnectEnginePostgresql" # - On Windows: use odbcadm.exe -# - On Linux: put these lines into /etc/odbc.ini +# - On Linux: put these lines into /etc/odbc.ini or in ~/.odbc.ini # #[ConnectEnginePostgresql] #Description=PostgreSQL DSN for ConnectSE -#Driver=PostgreSQL (should the path to the driver so file) +#Driver=PostgreSQL (should the path to the driver so file, on linux: /usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so) #Database=mtr #Servername=localhost #Port=5432 # # 5. Allow user "mtr" to connect to the database "mtr" -# Add this line into the begginning of pg_hba.conf -# (usually /var/lib/pgsql/data/pg_hba.conf on Linux): +# Find `pg_hba.conf` file: +# Run `SHOW hba_file;` or `locate pg_hba.conf` to find right location +# (usually /var/lib/pgsql/data/pg_hba.conf or /etc/postgresql/[version]/main/pg_hba.conf on Linux) +# Add this line into the beginning of pg_hba.conf: +# For unix socket connection (connect with `psql -U mtr`) +#local mtr mtr password +# For TCP/IP connection (connect with `psql -U mtr -h 127.0.0.1`) #host mtr mtr 127.0.0.1/32 password # # 6. Restart the server: |