[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

--- Comment #20 from Robert Großkopf  ---
Think this isn't a specific MySQL driver problem, because it will appear in
ODBC, JDBC and with direct connection.

It doesn't appear, for example, in Firebird, because Firebird will only connect
to one database and won't show other databases in pane "Tables".

It doesn't appear in PostgreSQL, because there is a schema name like "public",
which will separate database name and table name.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

--- Comment #19 from Alex Thurgood  ---
Think you're on the right track here. That append probably shouldn't happen
here, but how to avoid that it does for this use case?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

Robert Großkopf  changed:

   What|Removed |Added

  Component|LibreOffice |Base

--- Comment #18 from Robert Großkopf  ---
(In reply to Julien Nabet from comment #15)
> 
> It just reminds me this patch https://gerrit.libreoffice.org/c/core/+/128579
> with Lionel's comments.

The bug with the dot appears also in LO 6.4.0.3. This patch had been submitted
later, so it would have nothing to do with the buggy behavior.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

--- Comment #17 from Robert Großkopf  ---
Only to complete this:
ODBC connection will give the same buggy behavior in LO.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

--- Comment #16 from Robert Großkopf  ---
Have tried a little bit more.

"MyTest.1.0" is the database name
"Table" is the table name

"MyTest" as database will appear with "1.0.Table"
and couldn't show the content. Seems GUI will give "MyTest.1.0.Table" as table
name.

"MyTest.1.0" will appear also. But GUI won't show any table there.

Query with
SELECT * FROM "MyTest.1.0"."Table"
will show the content of the table. But the table will appear write protected.
So you could contact to the tables trough queries, but you couldn't add any
data without using tools → SQL or using macro code.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-03 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

Julien Nabet  changed:

   What|Removed |Added

 CC|serval2...@yahoo.fr |

--- Comment #15 from Julien Nabet  ---
Here's a bt showing that at the beginning, schema name is ok:
#0 
dbtools::impl_doComposeTableName(com::sun::star::uno::Reference
const&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, bool,
dbtools::EComposeRule) (_rxMetaData=uno::Reference to
(connectivity::mysqlc::ODatabaseMetaData *) 0x4c47498, _rCatalog="def",
_rSchema="test.00", _rName="test", _bQuote=false,
_eComposeRule=dbtools::EComposeRule::InDataManipulation)
at connectivity/source/commontools/dbtools.cxx:833
#1  0x7f8aa5795b19 in
dbtools::composeTableName(com::sun::star::uno::Reference
const&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, bool,
dbtools::EComposeRule)
(_rxMetaData=uno::Reference to (connectivity::mysqlc::ODatabaseMetaData *)
0x4c47498, _rCatalog="def", _rSchema="test.00", _rName="test", _bQuote=false,
_eComposeRule=dbtools::EComposeRule::InDataManipulation) at
connectivity/source/commontools/dbtools.cxx:1292
#2  0x7f8aa585f752 in
connectivity::sdbcx::OCatalog::buildName(com::sun::star::uno::Reference
const&)
(this=0x4c36e70, _xRow=uno::Reference to (connectivity::mysqlc::OResultSet
*) 0x4c7c878) at connectivity/source/sdbcx/VCatalog.cxx:181
#3  0x7f8aa585f87b in
connectivity::sdbcx::OCatalog::fillNames(com::sun::star::uno::Reference&,
std::__debug::vector >&)
(this=0x4c36e70, _xResult=uno::Reference to
(connectivity::mysqlc::OResultSet *) 0x4c7c870, _rNames=std::__debug::vector of
length 28, capacity 40 = {...}) at connectivity/source/sdbcx/VCatalog.cxx:193
#4  0x7f8a96bfa225 in connectivity::mysqlc::Catalog::refreshTables()
(this=0x4c36e70) at connectivity/source/drivers/mysqlc/mysqlc_catalog.cxx:32

Now the pb arises at this point connectivity/source/commontools/dbtools.cxx
832 if ( !_rSchema.isEmpty() && aNameComps.bSchemas )
833 {
834 aComposedName.append( _bQuote ? quoteName( sQuoteString,
_rSchema ) : _rSchema );
835 aComposedName.append( "." );
836 }

_bQuote is false so a dot is added in aComposedName and for a schema call
"test.00" we get here:
"test.00."
obviously any caller which parses this can't know that the beginning of the
table name is after the second dot and not after first dot.

It just reminds me this patch https://gerrit.libreoffice.org/c/core/+/128579
with Lionel's comments.
I struggled some time to make maximum things on mysqlc to work but gave up and
try to provide some minimal so with schemas or tables which don't include a dot
since it's a kind of special character.

Now I'm far from being an expert or perhaps I missed something obvious, anyway
if someone knows how to fix this, you're welcome of course! :-)

Can't help here=>uncc myself.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-03 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

--- Comment #14 from Alex Thurgood  ---
Sounds like something not quite right in 

connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx ?

Lines 834-843:
OUString query = buffer.makeStringAndClear();
// TODO use prepared stmt instead
// TODO escape schema, table name ?
query = query.replaceFirst("?", schemaPattern);
query = query.replaceFirst("?", tableNamePattern);
Reference statement = m_rConnection.createStatement();
Reference rs = statement->executeQuery(query);
return rs;

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-03 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

--- Comment #13 from Shlomo belleli  ---
It is still less expensive and less dangerous from the bugs in the  list  here
https://www.geeksforgeeks.org/10-famous-bugs-in-the-computer-science-world/

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-03 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

--- Comment #12 from Alex Thurgood  ---
Gotta love our schema string parser code :-/

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 149434] MySQL/MariaDB: Database name with dot will be split at first dot, rest will added to table names

2022-06-03 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=149434

Robert Großkopf  changed:

   What|Removed |Added

Summary|name of tables in database  |MySQL/MariaDB: Database
   |schema  |name with dot will be split
   ||at first dot, rest will
   ||added to table names

-- 
You are receiving this mail because:
You are the assignee for the bug.