[root] / trunk / io / sql / src / TSQLStructure.cxx Repository:
ViewVC logotype

Log of /trunk/io/sql/src/TSQLStructure.cxx

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 48992 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 28 15:26:26 2013 UTC (21 months, 3 weeks ago) by rdm
File length: 71369 byte(s)
Diff to previous 44507
From Lifeng Sun:
The attached patchset fixes a bunch of typo in the source:
0001-succes-success.patch
0002-preceed-preced.patch
0003-informations-information.patch
0004-childs-children.patch
0005-avaliable-available.patch
0006-writeable-writable.patch
0007-comand-command.patch
0008-unkown-unknown.patch
0009-wierd-weird.patch
0010-wheter-whether.patch
0011-unecessary-unnecessary.patch
0012-splitted-split.patch
0013-registerd-registered.patch
0014-recieve-receive.patch
0015-processsing-processing.patch
0016-ouput-output.patch
0017-mutiple-multiple.patch
0018-lenght-length.patch
0019-interupted-interrupted.patch
0020-independant-independent.patch
0021-inconsistant-inconsistent.patch
0022-expresion-expression.patch
0023-explicitely-explicitly.patch
0024-enviroment-environment.patch
0025-deafult-default.patch
0026-continous-continuous.patch
0027-completly-completely.patch
0028-commited-committed.patch
0029-choosen-chosen.patch
0030-backgroud-background.patch
0031-auxilliary-auxiliary.patch
0032-authentification-authentication.patch
0033-appropiate-appropriate.patch
0034-an-other-another.patch
0035-environement-environment.patch
0036-targetting-targeting.patch
0037-suppported-supported.patch
0038-paramater-parameter.patch

Revision 44507 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 4 12:30:41 2012 UTC (2 years, 7 months ago) by axel
File length: 71367 byte(s)
Diff to previous 43517
Remove
  using namespace std;
from Riostream.h, which has huge consequences for all of ROOT.
Riostream.h is now a simple wrapper for fstream, iostream, iomanip for backward compatibility; Riosfwd.h simply wraps iosfwd.

Because of templates and their inline functions, Riostream.h needed to be included in headers, too (e.g. TParameter.h), which violated the assumption that Riostream.h is not exposing its using namespace std to headers.
ROOT now requires R__ANSISTREAM, R__SSTREAM, which does not change the set of supported compilers.

Without "using namespace std", several identifiers are now prefixed by std::; e.g. roofit/* source files now have a using namespace std to keep their coding style.
TFile::MakeProject() now generates "using namespace std" to convert the CINT-style class names into C++ ones.

Revision 43517 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 27 21:54:05 2012 UTC (2 years, 9 months ago) by pcanal
File length: 71207 byte(s)
Diff to previous 41244
Fix coding conventions RN9 (Non-static data members begin with 'f' followed by a capital letter; methods begin with a capital letter.);

Revision 41244 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Oct 6 19:42:35 2011 UTC (3 years, 3 months ago) by pcanal
File length: 70971 byte(s)
Diff to previous 41016
Fix Coverity issues:

TBranchSTL: cov 34339 Resource leak (false positive)
TTableDescriptor.cxx: cov 34219,34220 explicit null dereference
TSQLStructure.cxx: cov 34204,34205,34206 Explicit null dereferenced 
TTabCom.cxx: cov 34168 Explicit null dereferenced 
TClassRef.cxx: cove 34165 Explicit null dereferenced (false positive but still confusing coding).
TBufferXML.cxx: 34070 Explicit null dereferenced
TFriendProxyDescriptor.cxx: cov 34066 Uninitialized scalar field
TTreeCloner.cxx: cov 34034057 Dereference null return (stat) 63 Uninitialized scalar field 
TParallelCoordEditor.cxx: 34051,34059,34060,34061 Dereference null return value
TParallelCoord.cxx: 34050,34056, 34057 Dereference null return (stat) 
TBranchProxy.h: 34048 Dereference null return value 
TBranchProxy.cxx: 34043,34044,34045 Dereference null return value
TTree.cxx: 34039 Dereference null return value
TTreePlayer.cxx: 34037 Dereference null return value 
TLeafC.cxx: 34036 Dereference null return value

Revision 41016 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 27 07:46:01 2011 UTC (3 years, 3 months ago) by pcanal
File length: 70963 byte(s)
Diff to previous 35985
Fix gcc 4.6.1 warning  variable ‘added’ set but not used

Revision 35985 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 1 10:24:07 2010 UTC (4 years, 3 months ago) by pcanal
File length: 70958 byte(s)
Diff to previous 34908
Fix cov 11110

Revision 34908 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 20 17:58:26 2010 UTC (4 years, 5 months ago) by pcanal
File length: 70978 byte(s)
Diff to previous 23457
Remove unused datamember

Revision 23457 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 23 13:00:41 2008 UTC (6 years, 9 months ago) by brun
File length: 71003 byte(s)
Diff to previous 23122
Fix a severe shadowed variable

Revision 23122 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 10 14:56:30 2008 UTC (6 years, 9 months ago) by rdm
File length: 71000 byte(s)
Diff to previous 22488
move the following directories into "io":

castor, chrip, dcache, gfal, io, rfio, sql, xml

Revision 22488 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 6 16:04:47 2008 UTC (6 years, 10 months ago) by rdm
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 71000 byte(s)
Diff to previous 20882
remove first batch of warning reported by gcc 4.3:
- warning: suggest parentheses around && within ||
- warning: suggest explicit braces to avoid ambiguous if else

Revision 20882 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:31:26 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 70915 byte(s)
Diff to previous 20170
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 20170 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 2 09:02:20 2007 UTC (7 years, 3 months ago) by brun
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 70915 byte(s)
Diff to previous 19826
First batch of changes to support the new data type Float16_t.
For more info about Float16_t see TBufferFile::WriteFloat16.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 70812 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 70868 byte(s)
Diff to previous 15512
remove :$ from tag line

Revision 15512 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 22 08:21:23 2006 UTC (8 years, 7 months ago) by brun
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 70878 byte(s)
Diff to previous 15125
From Sergey Linev:
1. Implementation of TDirectory I/O for TSQLFile and TXMLFile
2. In TSQLFile identifier length is now controled.
   Important for Oracle, where table or column name cannot be more than 32 symbols.
3. Adding usage of TSQLStatement class where possible.
4. Small performance improvment.

Revision 15125 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 22 08:55:58 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 65209 byte(s)
Diff to previous 15007
From sergei Linev:
1. Streamer info are now stored/read from SQL database.
2. Usage of TSQLStatement class (speed up for Oracle)
3. Tested and adjusted for ODBC plugin

Revision 15007 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 12 08:17:02 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 61549 byte(s)
Diff to previous 14994
Fix coding conventions violations.

Revision 14994 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 11 10:29:45 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 61549 byte(s)
Diff to previous 14739
Fix coding conventions

Revision 14739 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 18 14:19:21 2006 UTC (8 years, 9 months ago) by rdm
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 61336 byte(s)
Diff to previous 13977
fix in 64bit printf format.

Revision 13977 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 1 18:57:41 2006 UTC (8 years, 11 months ago) by pcanal
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 61659 byte(s)
Diff to previous 13524
From Sergei Linev:
Move CreateKey from TDirectory to TFile
Here is also optimisation of SQL statements and adjustement for Oracle.
Implementation of ClassBegin()/ClassMember()/ClassEnd() methdos for TBufferSQL2 and TBufferXML.
I also implementation for ClassMemeber() method for case of "raw:data" for SQL and XML cases.

Revision 13524 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 7 14:59:57 2005 UTC (9 years, 1 month ago) by rdm
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 59423 byte(s)
Diff to previous 13435
fix cvs indentification line: net -> sql.

Revision 13435 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 1 16:30:43 2005 UTC (9 years, 1 month ago) by pcanal
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 59423 byte(s)
Diff to previous 13420
From Sergei Linev:

This patch allows more clear representation of TClonesArray data in TSQLFile.

It also solves problem of correct saving of array of objects in TSQLFile.
I redefine in TBufferSQL2 following functions:

void WriteFastArray(void* start, const TClass* cl, Int_t n, TMemberStreamer* s)
Int_t WriteFastArray(void** startp, const TClass* cl, Int_t n, Bool_t isPreAlloc, TMemberStreamer* s)
void ReadFastArray(void* start, const TClass* cl, Int_t n = 1, TMemberStreamer* s = 0)
void ReadFastArray(void** startp, const TClass* cl, Int_t n = 1, Bool_t isPreAlloc = kFALSE, TMemberStreamer* s = 0)

In these functions I make replacement which I propose before - instead of cl->Streamer(buf, obj),
I use buf->StreamObject(obj, cl) ("parenthesis" arround cl->Streamer(buf, obj) call)
In case of TBufferSQL2 I treat StreamObject() as WriteObject()/ReadObject()
calls. Therefore, I can solve problem with objects array. Now it is easy to produce one column for
each array element.

Revision 13420 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 1 08:23:00 2005 UTC (9 years, 1 month ago) by brun
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 56650 byte(s)
Diff to previous 13383
Remove unused statement in TSQLStructure::TryConvertObjectArray

Revision 13383 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 28 23:22:31 2005 UTC (9 years, 1 month ago) by pcanal
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 56648 byte(s)
Diff to previous 13349
From Sergei Linev:
I made following modification:

1. Usage of table indexes. By default, they created only for basic tables: KeysTable and ObjectsTable.
   It is possible to configure TSQLFile to create indexes also for other type of tables or disable indexes at all.

2. Use of transaction. Now by default this option on and protect storage of object data to datatables.
   For some types of MySQL tables transaction are not supported, therefore I include in configurations
   possibility to setup type of table which should be used.

3. Configurations. For all kind of configuration I create small table.
   Configurations can be changed only when TSQLFile is created with option "CREATE" or "RECREATE".
   In that case configurations can be changed until first write operation.

4. Locking. I did not use "native" database locking mechnism while they are very different in MySQL and Oracle and
   may differ also in other SQL database. I put in Configuration table one flag, which says if database is already
   opened for writing by other TSQLFile instance and prevent other TSQLFile to have write access.
   For emergency cases one can use "BREAKLOCK" option in TSQLFile constructor to ignore that locking.
   This is not real locking and any other user with normal sql queries can disturb tables data, but I do not see
   now other solution, which may work for different databases. May be you know better solutions?

Revision 13349 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 24 16:57:23 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 56283 byte(s)
Diff to previous 13317
From Sergei Linev:
I introduce new function TSQLFile::MakeSelectQuery.
It produces SQL query, which can be used outside ROOT to get all objects data (including data from parent classes)
with single SELECT statement. As result, one table with all data is produced.

Revision 13317 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 22 20:42:37 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 54506 byte(s)
Diff to previous 13312
From Sergei:
Fix white spaces, add more comment to functions, add CVS tag lines and copyright.
It should now work  for array of objects and most stl classes.
I put limitation for array size. If array with fixed size exceed limit (default 20),
array will be converted to raw data, otherwise each element of array will be presented as
single column.

Revision 13312 - (view) (download) (as text) (annotate) - [select for diffs]
Added Mon Nov 21 17:38:24 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/sql/src/TSQLStructure.cxx
File length: 49540 byte(s)
From Sergey:

Introduce a "transparent" access to SQL data base via standard TFile interface.

The main approach that each class (but not each object) has one or two tables
with names like $(CLASSNAME)_ver$(VERSION) and $(CLASSNAME)_streamer_ver$(VERSION)
For example: TAxis_ver8 or TList_streamer_ver5
Second kind of tables appears, when some of class members can not be converted to
normalized form or when class has custom streamer.
For instance, for TH1 class two tables are required: TH1_ver4 and TH1_streamer_ver4
Most of memebers are stored in TH1_ver4 table columnwise, and only memeber:

Double_t*  fBuffer;  //[fBufferSize]

can not be represented as column while size of array is not known apriory.
Therefore, fBuffer will be written as list of values in TH1_streamer_ver4 table.

All objects, stored in the DB, will be registered in table "ObjectsTable".
In this there are following columns:
"key:id"  - key identifier to which belong object
"obj:id"  - object identifier
"Class"   - object class name
"Version" - object class version
Data in each "ObjectsTable" row uniqly identify, in which table
and which column object is stored.

In normal situation all class data should be sorted columnwise.
Up to now following member are supported:
1) Basic data types
Here is everything clear. Column SQL type will be as much as possible
close to the original type of value.
2) Fixed array of basic data types
In this case n columns like fArr[0], fArr[1] and so on will be created.
If there is multidimensional array, names will be fArr2[1][2][1] and so on
3) Parent class
In this case version of parent class is stored and
data of parent class will be stored with the same obj:id in corrspondent table.
There is a special case, when parent store nothing (this is for instance TQObject).
In that case just -1 is written to avoid any extra checks if table exist or not.
4) Object as data member.
In that case object is saved in normal way to data base and column
will contain id of this object.
5) Pointer on object
Same as before. In case if object was already stored, just its id
will be placed in the column. For NULL pointer 0 is used.
6) TString
Now column with limited width like VARCAHR(255) in MySQL is used.
Later this will be improved to support maximum possible strings
7) Anything else.
Data will be converted to raw format and saved in _streamer_ table.
Each row supplied with obj:id and row:id, where row:id indicates
data, corresponding to this particular data member, and column
will contain this raw:id

See the TSQLFile documentation for more details.

example of a session saving data to a SQL data base
=====================================================

const char* dbname = "mysql://host.domain:3306/dbname";
const char* username = "username";
const char* userpass = "userpass";

// Clean data base and create primary tables
TSQLFile* f = new TSQLFile(dbname, "recreate", username, userpass);
// Write with standard I/O functions
arr->Write("arr",TObject::kSingleKey);
h1->Write("histo");
// Close connection to DB
delete f;

example of a session read data from SQL data base
=====================================================

// Open database again in read-only mode
TSQLFile* f = new TSQLFile(dbname, "open", username, userpass);
// Show list of keys
f->ls();
// Read stored object, again standard ROOT I/O
TH1* h1 = (TH1*) f->Get("histo");
if (h1!=0) { h1->SetDirectory(0); h1->Draw(); }
TObject* obj = f->Get("arr");
if (obj!=0) obj->Print("*");
// close connection to DB
delete f;

Known problems and open questions.
1) TTree is not supported by TSQLFile. There is independent development
of TTreeSQL, which allows to store trees directly in SQL database
2) TClonesArray is not tested, will be adjusted soon.
3) TDirectory cannot work. Hopefully, will (changes in ROOT basic I/O is required)
4) Streamer infos are not written to file, therefore schema evolution
is not yet supported. All eforts are done to enable this feature in
the near future

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9