my $clearQuery="DELETE FROM collection_discography_artist_join WHERE collection_info=". $this->{collectionId};
please don't do this :)
niklas
oh. how should I do it?
luks
"... WHERE collection_info = ?"
niklas
ah alright
luks
and then pass the argument separately to $sql->Do
niklas
Im on it :)
luks
sql injections are BAD :)
niklas
true
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
luks looks
Infinito- joined the channel
Crazee_Canuck
Wizzcat, that url didn't work for me but I can guess what it's for; I've seen that too
*guess what it shows
eh..
luks
niklas: $sqlro->SelectSingleValue("SELECT id FROM moderator WHERE name='". $r->user ."'"); reminds me of one xkcd strip :)
in cgi-bin/MusicBrainz/Server/Handlers/WS/1/Collection.pm
niklas
hehe ok :) I've replaced the SQL queries in Collection.pm to pass values using ? instead now
luks
really, check all your sql changes and convert them to placeholders
Shepard
hehe, little bobby tables
srotta
8)
CatCat
hm
luks
niklas: well, first thing: for queries like "SELECT * FROM collection_info WHERE moderator='$userId'" you definitely need an index on collection_info.moderator
(and again sql injection :))
niklas
hmm need an index on collection_info.moderator?
I think I've created an index for it
not sure if its on moderator though
luks
you have an index for collection_info.id
which helps you for "WHERE id = ?"
niklas
ah. how do I know which field to set index on?
luks
but you are doing "WHERE moderator = ?", which currently scans the whole table
niklas
ah
I think I see
luks
the fields you are querying on
Wizzcat
Crazee_Canuck: heh yeah, the asin was just nuked
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
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
but it works when I do "... gid = $mbid"
luks
niklas: did I said "WHERE name = '?'" or "WHERE name = ?"?