close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 20 years ago

Closed 18 years ago

#310 closed defect (fixed)

Not Allowed Series names in DBSeries* functions

Reported by: Alfredo Torre Owned by: danirus
Priority: highest Milestone:
Component: DataBase Version: head
Severity: major Keywords:
Cc: imendez, rcsoto, Javier Portugal

Description

Please, try to compile this TOL code. It's an example to show that TOL creates
Series with names that aren't allowed in TOL.
Note: The example runs under MySQL.

Set SetSerNA = SqlDBSeriesColumn(
"
select 'Not Allowed Name' as nameX, str_to_date('2005/01/01', '%Y/%m/%d') as
dateX, 1 as valueX from dual
", "Diario", 0);
Text NameSer = Name(SetSerNA[1]);
Serie SrNA = Eval(NameSer);

Change History (6)

comment:1 Changed 20 years ago by Alfredo Torre

Cc: rcsoto imendez Javier Portugal added

comment:2 Changed 20 years ago by imendez

Fredi's example shows you can create a series from DBSeriesXXX with a name
containing blanks, what wouldn't be allowed.
But TOL lets also create series whose names contain not-allowed characters, such
as @,',|,% and so on

Regards

comment:3 Changed 19 years ago by danirus

Resolution: fixed
Status: newclosed

This bug has been resolved.
Now, using DBSeriesXXX functions it's not possible to create an object with an
invalid identifier.

You can try the following code:

--------------------------------------------------
DDBB Connection using Tol-MySQL direct:
Struct DBStructMySQL { Text driver, Text database, Text host };
Set TolMySQL = DBStructMySQL("mysql", "tol_development", "localhost");
Real DBOpen("TolMySQL_Direct", "danirus", "", TolMySQL);

--------------------------------------------------
Error with DBSeries --
Set dbSeries1 = DBSeries("select * from series", Diario,

SetOfText("ser 1 a", "ser 1 b"));

--------------------------------------------------
Error with DBSeriesColumn --
Set SetSerNA = DBSeriesColumn("select 'Not Allowed Name' as nameX,

str_to_date('2005/01/01', '%Y/%m/%d') as dateX,

1 as valueX from dual", Diario, 0);

--------------------------------------------------
Error with DBSeriesTable --
Text getSeriesSQL = "select \"ser ie\", Date, ser1, ser2 from series";
Set setSeries = DBSeriesTable(getSeriesSQL,Diario,SetOfText("Data1","Data2"));

Cheers,
Daniel

comment:4 Changed 19 years ago by sdelfresno

Resolution: fixed
Status: closedreopened

Now, the following TOL code gives error:

Text getSrSql = "select '2Sr', str_to_date('2005/01/01', '%Y/%m/%d'), 1, 2 from
dual";
Set sSer = DBSeriesTable(getSrSql,Diario,X","Y?);

However, the following code is OK:

Text getSrSql = "select 'Sr', str_to_date('2005/01/01', '%Y/%m/%d'), 1, 2 from
dual";
Set sSer = DBSeriesTable(getSrSql,Diario,X","Y?);

The error is because in the first case the name of the series begins by number

comment:5 Changed 19 years ago by imendez

Priority: highhighest

comment:6 Changed 18 years ago by danirus

Resolution: fixed
Status: reopenedclosed

This bug was resolved a long time ago, but not closed.
It is possible to create a Serie with name "2Sr" or another name starting with a digit, but it's deprecated, and will be prohibited in the next coming release.

Cheers.

Note: See TracTickets for help on using tickets.