1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Adding a loop test to prevent PROXY based table to loop when repointing on itself.

- Fix bug causing PROXY on non CONNECT tables to sometimes use the wrong DB.
- Making some more tests in create that were in pre_create not called anymore
  when columns are defined.
- Updating some test results to reflect new warnings.

modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/tbl.result
  storage/connect/mysql-test/connect/r/upd.result
  storage/connect/tabcol.h
  storage/connect/tabmysql.cpp
  storage/connect/taboccur.cpp
  storage/connect/taboccur.h
  storage/connect/tabtbl.cpp
  storage/connect/tabtbl.h
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/tabxcl.cpp
  storage/connect/tabxcl.h
This commit is contained in:
Olivier Bertrand
2013-05-02 16:33:15 +02:00
parent 3d4adc3fdf
commit f3e944099e
13 changed files with 132 additions and 490 deletions

View File

@@ -283,25 +283,36 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
Desc = "MySQL Table";
if (!stricmp(am, "MYPRX"))
// MYSQL access from a PROXY table,
// we must get parms from the calling table
Remove_tshp(Cat);
if (!stricmp(am, "MYPRX")) {
// Normal case of specific MYSQL table
if (!url || !*url) {
// Not using the connection URL
Hostname = Cat->GetStringCatInfo(g, "Host", "localhost");
Database = Cat->GetStringCatInfo(g, "Database", "*");
Tabname = Cat->GetStringCatInfo(g, "Name", Name); // Deprecated
Tabname = Cat->GetStringCatInfo(g, "Tabname", Tabname);
Username = Cat->GetStringCatInfo(g, "User", "*");
Password = Cat->GetStringCatInfo(g, "Password", NULL);
Portnumber = Cat->GetIntCatInfo("Port", mysqld_port);
} else if (ParseURL(g, url))
return TRUE;
if (!url || !*url) {
// Not using the connection URL
Hostname = Cat->GetStringCatInfo(g, "Host", "localhost");
Bind = !!Cat->GetIntCatInfo("Bind", 0);
Delayed = !!Cat->GetIntCatInfo("Delayed", 0);
} else {
// MYSQL access from a PROXY table, not using URL
Database = Cat->GetStringCatInfo(g, "Database", "*");
Tabname = Cat->GetStringCatInfo(g, "Name", Name); // Deprecated
Tabname = Cat->GetStringCatInfo(g, "Tabname", Tabname);
// We must get connection parms from the calling table
Remove_tshp(Cat);
Hostname = Cat->GetStringCatInfo(g, "Host", "localhost");
Username = Cat->GetStringCatInfo(g, "User", "*");
Password = Cat->GetStringCatInfo(g, "Password", NULL);
Portnumber = Cat->GetIntCatInfo("Port", mysqld_port);
} else if (ParseURL(g, url))
return TRUE;
} // endif am
Bind = !!Cat->GetIntCatInfo("Bind", 0);
Delayed = !!Cat->GetIntCatInfo("Delayed", 0);
return FALSE;
} // end of DefineAM