Closed GoogleCodeExporter closed 9 years ago
DATATYPES: Useless in my opinion. The only change it makes that it makes it
_constant_ explicitely, i.e. cannot changed later on. But not much of a
benefit. We should not mess with (i.e. overwrite) any config variable unless we
have a very good reason.
FUNCTIONS: Here we mess with $functions as we overwrite it ;-) But yes, I
agree, we can get rid of the constant. But we should not write to $functions
when merging, but use some new variable for the merge with custom functions.
You already clear this up with your patch.
CUSTOM_FUNCTIONS: Yeah. Database->fns seems useless as only a copy of
CUSTOM_FUNCTIONS and never read.
Your patch looks good. Only two spaces for intention in registerUserFunction().
Only thing I see: You only call registerUserFunction once, but Database objects
are created at multiple places. So this changes behaviour (in some cases, user
functions don't get registered anylonger). These cases are:
- create new db
- export db as sql
- export db as csv
- import db
In some cases this might change behaviour noticeably. I.e. if a dump uses a
user function, you cannot import it any longer.
Original comment by crazy4ch...@gmail.com
on 22 Apr 2013 at 10:15
Right! We should register custom functions also when importing data, at least.
Attached is a new patch to fix that, and the two rogue spaces.
We still have 'FORCETYPE' and 'PAGE' around, but I'm leaving them for later. I
don't feel confortable hacking at the Database class yet, but I'd like to clean
up the constructor and remove all output from the class. Also, there are a lot
of 'if($this->type==' around...
Original comment by dreadnaut
on 24 Apr 2013 at 10:32
Attachments:
Looks good. Feel free to commit it.
Original comment by crazy4ch...@gmail.com
on 26 Apr 2013 at 7:16
This issue was closed by revision r412.
Original comment by dreadnaut
on 30 Apr 2013 at 11:40
Thanks.
Original comment by crazy4ch...@gmail.com
on 30 Apr 2013 at 11:45
Thank you for checking my code!
Original comment by dreadnaut
on 30 Apr 2013 at 11:46
Original comment by crazy4ch...@gmail.com
on 2 Jan 2014 at 4:26
Original issue reported on code.google.com by
dreadnaut
on 6 Apr 2013 at 7:57Attachments: