my $clearQuery="DELETE FROM collection_discography_artist_join WHERE collection_info=". $this->{collectionId};
2008-07-13 19537, 2008
luks
please don't do this :)
2008-07-13 19547, 2008
niklas
oh. how should I do it?
2008-07-13 19551, 2008
luks
"... WHERE collection_info = ?"
2008-07-13 19556, 2008
niklas
ah alright
2008-07-13 19503, 2008
luks
and then pass the argument separately to $sql->Do
2008-07-13 19505, 2008
niklas
Im on it :)
2008-07-13 19511, 2008
luks
sql injections are BAD :)
2008-07-13 19518, 2008
niklas
true
2008-07-13 19541, 2008
niklas
luks: do you have any idea why the collection webservice is VERY slow? is that normal? e.g. ace.csbnet.se/ws/1/collection?addalbums=49bc0156-912e-46ed-97f0-acc3e3122030 takes quite some seconds to load
only problem is if the asin is attached to other releases you can't really change
2008-07-13 19549, 2008
luks looks
2008-07-13 19503, 2008
Infinito- joined the channel
2008-07-13 19544, 2008
Crazee_Canuck
Wizzcat, that url didn't work for me but I can guess what it's for; I've seen that too
2008-07-13 19555, 2008
Crazee_Canuck
*guess what it shows
2008-07-13 19557, 2008
Crazee_Canuck
eh..
2008-07-13 19521, 2008
luks
niklas: $sqlro->SelectSingleValue("SELECT id FROM moderator WHERE name='". $r->user ."'"); reminds me of one xkcd strip :)
2008-07-13 19544, 2008
luks
in cgi-bin/MusicBrainz/Server/Handlers/WS/1/Collection.pm
2008-07-13 19559, 2008
niklas
hehe ok :) I've replaced the SQL queries in Collection.pm to pass values using ? instead now
2008-07-13 19500, 2008
luks
really, check all your sql changes and convert them to placeholders
2008-07-13 19526, 2008
Shepard
hehe, little bobby tables
2008-07-13 19543, 2008
srotta
8)
2008-07-13 19544, 2008
CatCat
hm
2008-07-13 19553, 2008
luks
niklas: well, first thing: for queries like "SELECT * FROM collection_info WHERE moderator='$userId'" you definitely need an index on collection_info.moderator
2008-07-13 19500, 2008
luks
(and again sql injection :))
2008-07-13 19556, 2008
niklas
hmm need an index on collection_info.moderator?
2008-07-13 19507, 2008
niklas
I think I've created an index for it
2008-07-13 19512, 2008
niklas
not sure if its on moderator though
2008-07-13 19525, 2008
luks
you have an index for collection_info.id
2008-07-13 19532, 2008
luks
which helps you for "WHERE id = ?"
2008-07-13 19541, 2008
niklas
ah. how do I know which field to set index on?
2008-07-13 19545, 2008
luks
but you are doing "WHERE moderator = ?", which currently scans the whole table
2008-07-13 19554, 2008
niklas
ah
2008-07-13 19510, 2008
niklas
I think I see
2008-07-13 19511, 2008
luks
the fields you are querying on
2008-07-13 19512, 2008
Wizzcat
Crazee_Canuck: heh yeah, the asin was just nuked
2008-07-13 19532, 2008
luks
most tables in MB are huge, so you need indexes for almost any query
here are you getting collectionId, but if the collection id doesn't exist, you create a new one but don't get ID of the new collection
2008-07-13 19550, 2008
niklas
but... when I do $rosql->SelectSingleValue("SELECT id FROM album WHERE gid = '?'", $mbid); I get the error: DBD::Pg::st execute failed: called with 1 bind variables when 0 are needed at /home/mbserver/svn/mb_server/cgi-bin/Sql.pm line 378
2008-07-13 19503, 2008
niklas
but it works when I do "... gid = $mbid"
2008-07-13 19523, 2008
luks
niklas: did I said "WHERE name = '?'" or "WHERE name = ?"?