00:00.15 | *** join/#storm wallflower (n=wallflow@ip-205-246-113-216.pool.grokthis.net) |
03:09.26 | *** join/#storm lymxz (n=lymxz@123.116.112.83) |
04:58.02 | *** join/#storm bigdog (n=scmikes@72-197-8-8-arpa.cust.cinci.current.net) |
05:13.50 | *** join/#storm bigdog (n=scmikes@72-197-8-8-arpa.cust.cinci.current.net) [NETSPLIT VICTIM] |
05:13.50 | *** join/#storm benoitc (i=benoitc@enki.osbud.net) [NETSPLIT VICTIM] |
05:13.50 | *** join/#storm weatherman (n=weatherm@204-174-36-245.unknown-dhcp802.dsl.ucc-net.ca) [NETSPLIT VICTIM] |
05:13.50 | *** join/#storm LarstiQ (n=larstiq@cust.7.157.adsl.cistron.nl) [NETSPLIT VICTIM] |
05:59.46 | *** join/#storm jukart (n=jukart@85-124-221-45.static.xdsl-line.inode.at) |
06:51.36 | *** join/#storm jukart (n=jukart@194.183.146.181) |
07:09.56 | *** join/#storm dobee (n=dobeee@194.183.146.186) |
07:17.06 | *** join/#storm bozzo (n=bozzo@BSN-210-246-204.dial-up.dsl.siol.net) |
09:43.24 | tarjei | wishlist item: len(ResultSet) should return the same as ResultSet.count() |
11:00.24 | *** join/#storm bozzo_ (n=bozzo@BSN-210-246-124.dial-up.dsl.siol.net) |
11:53.38 | *** join/#storm niemeyer (n=niemeyer@200-163-194-246.ctame705.dsl.brasiltelecom.net.br) |
13:07.41 | *** join/#storm mcella (n=michele@ip-171-30.sn3.eutelia.it) |
13:18.25 | *** join/#storm jukart (n=jukart@194.183.146.181) |
13:50.34 | radix | tarjei: unlikely. too many things randomly call len() on objects in places where you don't want queries to hapen. |
14:02.18 | *** join/#storm Zenom (n=Zenom@unaffiliated/aj1973) |
14:22.27 | tarjei | radix: ah, that's true. |
14:22.34 | tarjei | if ResultSet etc. |
14:23.37 | radix | hmm. I'm not sure if that's one, but I think "for x in resultset" might be one. |
14:25.13 | radix | oh, I see. "if" calls it if __nonzero__ is not defined. |
14:26.15 | radix | hmm. I guess I was totally wrong |
14:26.16 | tarjei | yep |
14:26.25 | radix | I thought 'for' would trigger __len__, but I can't seem to get that to happen. |
14:26.50 | tarjei | still, I think it is a valid reason not to implement len(ResultSet) |
14:45.13 | *** join/#storm niemeyer (n=niemeyer@201-10-93-231.ctame705.dsl.brasiltelecom.net.br) |
15:20.45 | *** join/#storm niemeyer (n=niemeyer@200-138-32-195.ctame705.dsl.brasiltelecom.net.br) |
16:47.39 | *** join/#storm bitsbam (n=nephish@63.98.191.58) |
16:47.46 | bitsbam | morning all |
16:48.31 | radix | Hi bitsbam |
16:48.58 | bitsbam | i had a question about changes from .1 to .11 |
16:49.08 | bitsbam | are strings handled differently? |
16:49.32 | radix | bitsbam: Don't think so. You're Shawn? |
16:49.42 | bitsbam | yes, you got my email ! |
16:49.45 | radix | yep :) |
16:49.48 | bitsbam | cool |
16:50.04 | bitsbam | do we use a pastie here ? |
16:50.09 | radix | Sure, whatever you want. |
16:50.18 | radix | http://rafb.net/paste is one I tend to use because it's got a short URL |
16:50.31 | bitsbam | opening right now, thanks |
16:50.34 | radix | Can you paste the traceback you're getting? |
16:50.43 | bitsbam | sure |
16:50.43 | radix | And, you didn't also upgrade your database library at the same time, did you? |
16:51.46 | bitsbam | well, here's the deal, we are upgrading to beefier hardware here at the shop, and so i did a mysql dump then import into the new server. The new server would be running a different MySQL version, but other than that, should be the sam |
16:51.53 | bitsbam | same i mean |
16:52.02 | radix | bitsbam: What client library are you using? |
16:52.18 | bitsbam | sorry, client library? |
16:52.27 | bitsbam | python mysql in ubuntu |
16:52.39 | radix | well, sorry, of course you're using MySQLdb, since that's what storm uses |
16:52.51 | bitsbam | ok |
16:52.56 | radix | but I'm betting you changed the version of that and it had an incompatible change where it started returning unicodes where it used to return strings, or vice versa. |
16:53.35 | bitsbam | ok, yes started returning strings. that is what is in the traceback.. expected unicode but got type str |
16:54.11 | radix | bitsbam: storm is very strict about unicode vs strings, because that's really the only sane thing to do. unfortunately many other libraries are only just figuring this out :) |
16:54.23 | radix | bitsbam: so mysqldb might have changed its API a bit. |
16:54.31 | radix | bitsbam: What MySQL datatype is your column? |
16:54.37 | bitsbam | varchar |
16:55.12 | radix | bitsbam: hmm. varchar should really be unicode |
16:55.21 | bitsbam | you know what, i am not getting the same error in a table that is innodb, the problem one is myisam |
16:55.26 | radix | bitsbam: which version in particular of MySQLdb are you using? |
16:55.32 | radix | hork. |
16:55.53 | radix | bitsbam: you should really not use myisam. it's not really compatible with storm's caching strategy, because storm assumes transactions, well, work :-) |
16:56.19 | radix | but that should be totally unrelated to the types that MySQLdb returns... |
16:56.25 | bitsbam | mysql is 5.0.45 ubuntu 7.10 |
16:56.44 | radix | niemeyer: are you aware of changes in MySQLdb regarding unicode / string representation of VARCHAR columns? |
16:57.33 | bitsbam | i had converted everything over to innodb, but this particular table was giving me troubles and lots of connection errors when i did that. so i but this ( and a couple of other tables ) back to myisam.. |
16:57.54 | bitsbam | the problem tables were the ones that get written to and read from the same rows very often |
16:57.59 | bitsbam | but anyway... |
16:58.24 | radix | woops, there he goes. |
16:58.31 | radix | niemeyer's been having connectivity problems today. :-( |
17:00.58 | bitsbam | radix: here is the code http://rafb.net/p/ePdcG215.html |
17:03.28 | bitsbam | sorry, got your question wrong. python-mysql (MySQLdb) version is 1.2.2-3 |
17:04.47 | *** join/#storm niemeyer (n=niemeyer@200-138-32-195.ctame705.dsl.brasiltelecom.net.br) |
17:42.36 | bitsbam | i just changed the table type to innodb and got the same error |
17:42.47 | bitsbam | forgot to paste the error. one sec |
17:44.49 | bitsbam | here is the traceback http://rafb.net/p/GD5hHb63.html |
17:56.41 | radix | bitsbam: ok, I'm a bit less scared now that you've got the same error in both table types |
17:56.58 | bitsbam | really ? i was more scared :) |
17:57.17 | radix | :( |
17:57.21 | *** join/#storm niemeyer (n=niemeyer@200-138-32-195.ctame705.dsl.brasiltelecom.net.br) |
17:57.24 | radix | :) |
17:57.41 | radix | bitsbam: ok, I'm back from a conference call i was having |
17:58.15 | bitsbam | ok, i am cool. |
17:58.15 | bitsbam | thanks |
17:58.15 | radix | bitsbam: Do you have python MySQLdb version 1.2.2-3 in the environment where the code *does* work? |
17:58.24 | bitsbam | lemme check |
17:59.49 | bitsbam | Version: 1.2.1-p2-4ubuntu2 |
17:59.56 | bitsbam | so, um.. .no |
18:03.01 | radix | hmm, pretty minor difference |
18:03.05 | radix | I wonder if there's anything interesting in the changelog |
18:04.36 | *** join/#storm niemeyer (n=niemeyer@200-138-32-195.ctame705.dsl.brasiltelecom.net.br) |
18:05.42 | bitsbam | storm doesn't have a declaration for a table column that is string, right? |
18:08.42 | radix | bitsbam: it does |
18:08.44 | radix | bitsbam: RawStr |
18:08.54 | radix | bitsbam: I guess you can use that, but it's pretty unexpected to need that when you're using VARCHAR :\ |
18:09.12 | radix | bitsbam: anyway, I need to travel home because the weather just started getting really bad. Sorry I've been really choppy in here |
18:09.29 | bitsbam | ok, thanks a lot |
18:18.36 | *** join/#storm dobee (n=dobeee@81-223-53-162.dornbirn.xdsl-line.inode.at) |
18:25.14 | *** part/#storm bitsbam (n=nephish@63.98.191.58) |
20:00.23 | *** join/#storm bozzo (n=bozzo@BSN-210-246-124.dial-up.dsl.siol.net) |
20:09.04 | *** join/#storm bitsbam (n=nephish@69.55.30.231) |
20:09.14 | bitsbam | hello all again |
20:29.15 | *** join/#storm niemeyer (n=niemeyer@200-138-32-195.ctame705.dsl.brasiltelecom.net.br) |
20:29.34 | bac | hi niemeyer |
20:46.57 | niemeyer | bac: Hey |
20:47.21 | bac | hi niemeyer -- did that test case i sent you make sense? |
20:51.14 | niemeyer | bac: I didn't get any test cases |
20:51.37 | bac | niemeyer: ah, i thought i mailed it to you yesterday. let me look. |
20:51.58 | niemeyer | bac: Oh, hold one |
20:52.00 | niemeyer | hold on |
20:52.10 | niemeyer | bac: I had my mind on a different subject, sorry |
20:52.17 | bac | niemeyer: no problem |
20:52.28 | niemeyer | bac: I'll check it out.. one moment |
20:52.44 | bac | niemeyer: also, i have a question about another odd behavior i'm having since moving to mysql |
20:53.20 | bac | it seems if i create a new object it is getting automatically added to the store. and if i do a rollback it has no effect. any ideas what i'm doing wrong? |
20:55.10 | bozzo | bac: are you using InnoDB or MyISAM tables? |
20:55.58 | bac | bozzo: myisam |
20:56.13 | bozzo | bac: myisam does not do transactions... |
20:56.21 | bac | bozzo: ah, ok |
20:56.41 | bac | bozzo: so is that specified on the schemata? |
20:57.33 | bozzo | bac: yeah CREATE TABLE ( ... ) ENGINE=InnoDB; |
20:57.33 | bac | bozzo: thanks! |
20:58.06 | bac | bozzo: i was hoping it was something simple |
21:01.04 | bac | bozzo: cool, that works! |
21:01.20 | bozzo | i think it would be possible set default engine for the DB, so you dont have to add it all over the place... |
21:01.33 | bozzo | check the refman... |
21:01.56 | bac | bozzo: it wasn't hard to change it everywhere and now i don't have to worry about setting up the next db properly. |
21:08.27 | bozzo | niemeyer: Say I wanted to display a list of blogs ( store.find(Blog) ) and for each blog also some summary over posts |
21:09.23 | bozzo | niemeyer: in SQL I'd do something alike SELECT blog.*, count(posts.id) from blog join posts on blog.id = posts.blogId group by blog.id; |
21:11.20 | bozzo | the best I can come up is a store.find(Blog) and a store.execute(SQL('select blog.id, count(posts.id) from blog join posts on blog.id posts.blogId group by blog.id')).get_all() and merge the results in python |
21:23.41 | *** join/#storm niemeyer (n=niemeyer@200-138-32-195.ctame705.dsl.brasiltelecom.net.br) |
21:41.29 | bitsbam | niemeyer: hey there |
21:43.48 | *** join/#storm dobee (n=dobeee@81-223-53-162.dornbirn.xdsl-line.inode.at) |
21:43.51 | niemeyer | bitsbam: Hey |
21:43.53 | niemeyer | bitsbam: My connection is highly unstable today |
21:43.55 | niemeyer | Apologies in advance if I fall out |
21:45.39 | bitsbam | niemeyer: no problem whatsoever, this is shawn, you answered me on the mailing list.. um... what do you mean by self contained test case? |
21:46.05 | niemeyer | bitsbam: Just a small test file that reproduces the problem |
21:46.18 | niemeyer | bac: Btw, I was able to reproduce the issue |
21:46.41 | bitsbam | ok, email it to the list? pastie? |
21:48.47 | bozzo | niemeyer: you probably missed what I asked above: Say I wanted to display a list of blogs ( store.find(Blog) ) and for each blog also some summary over posts |
21:48.47 | niemeyer | bozzo: Ok |
21:48.47 | niemeyer | bitsbam: Yes, email please |
21:48.47 | bozzo | in SQL I'd do something alike SELECT blog.*, count(posts.id) from blog join posts on blog.id = posts.blogId group by blog.id; |
21:48.59 | bitsbam | ok ,will do |
21:49.56 | bozzo | I see the Select() takes a group by, but I have no clue how to make Store() read a handcrafted Select() |
21:49.59 | niemeyer | bozzo: Selecting the objects and the count in a single select isn't possible right now, even though it's planned |
21:50.32 | niemeyer | bozzo: OTOH, There's something strange in that query |
21:50.42 | niemeyer | bozzo: group by blog.id doesn't make much sense |
21:51.00 | niemeyer | bozzo: (to me) |
21:51.01 | bozzo | well it makes count(posts.id) be per blog |
21:51.30 | niemeyer | Hmmm |
21:52.21 | niemeyer | I see, I guess I've never done something like that |
21:52.27 | niemeyer | Looks nice |
21:52.28 | niemeyer | Anyway |
21:52.56 | niemeyer | bozzo: group by isn't supported in Storm to look for objects right now |
21:54.57 | bozzo | niemeyer: fair enough. It's not such a problem to do a join in python |
22:05.38 | *** join/#storm bitsbam_ (n=nephish@69.55.28.164) |
22:10.46 | bozzo | niemeyer: with mysql and python2.5 and recent enough MySQLdb a database column 'plain_str varchar(10) CHARACTER SET ascii COLLATE ascii_bin' will return a str() not a unicode() |
22:18.32 | bitsbam_ | hello |
22:18.39 | bitsbam_ | my connection is flaky too |
22:29.40 | *** join/#storm bitsbam (n=nephish@69.55.28.164) |
23:48.19 | *** part/#storm bitsbam (n=nephish@69.55.28.164) |