<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:jnplg@outlook.com" title="jnplg@outlook.com">jnplg@outlook.com</a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Some LO Base views with conversions or casting on datetime fields causing error message "the data content could not be loaded" with MySQL Connector/J 8 (not with with MySQL Connector/J 5)"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=120091">bug 120091</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Summary</td>
<td>Some fields causing error message "the data content could not be loaded" with MySQL Connector/J 8.0.11 or 8.0.12 in tables and views
</td>
<td>Some LO Base views with conversions or casting on datetime fields causing error message "the data content could not be loaded" with MySQL Connector/J 8 (not with with MySQL Connector/J 5)
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Some LO Base views with conversions or casting on datetime fields causing error message "the data content could not be loaded" with MySQL Connector/J 8 (not with with MySQL Connector/J 5)"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=120091#c11">Comment # 11</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Some LO Base views with conversions or casting on datetime fields causing error message "the data content could not be loaded" with MySQL Connector/J 8 (not with with MySQL Connector/J 5)"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=120091">bug 120091</a>
from <span class="vcard"><a class="email" href="mailto:jnplg@outlook.com" title="jnplg@outlook.com">jnplg@outlook.com</a>
</span></b>
<pre>I did some additional research on this problem : it appears when trying to
access a view which contains a CAST as DATE (or TIME) function on a DATETIME
(or TIMESTAMP) column.
Here is a short sample :
1. create a table with a datetime column :
CREATE TABLE `dt` (`datetime1` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`datetime1`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
2. insert a value :
INSERT INTO `testcj8`.`dt` (`datetime1`) VALUES ('2018-11-11 11:11:11');
3. create a view on this table, with a "cast as date" function on the datetime
column :
CREATE VIEW `view-dt` AS select `dt`.`datetime1` AS `datetime1`,
cast(`dt`.`datetime1` as date) AS `date1`, cast(`dt`.`datetime1` as time) AS
`time1` from `dt`;
4. access this view : SELECT * FROM `view-dt`;
- If LO base is connected to MySQL with MySQL Connector/J 5, there is no
problem.
- If LO base is connected to MySQL with MySQL Connector/J 8, there is a
problem : msg "the data could not be loaded".
Please note that the select statement used to create the view can be
successfully executed with both connectors !!!</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>