Issue information

Issue ID
#6108
Status
Fixed
Severity
Fair
Started
Hercules Elf Bot
Jun 25, 2012 17:04
Last Post
Hercules Elf Bot
Nov 11, 2012 1:13
Confirmation
Yes (1)
No (0)

Hercules Elf Bot - Jun 25, 2012 17:04

Originally posted by [b]Mooka[/b]
Hello Devs,
I found a problem with getd() when used within query_sql() command.

For example: (A stupid example but useful to show the problem)
[code]

- script Test -1,{

OnInit:
for(set .@i, 0; .@i < 3; set .@i, .@i + 1)
query_sql("SELECT `account_id` FROM `login` WHERE `account_id`="+(2000000 + (125*.@i))+" LIMIT 125", getd("$@AID_LIST_"+.@i));
}


[/code]

Then give @reloadscript three times.
Console Error:
[img]https://dl.dropbox.com/u/38027321/img/example_error.jpg[/img]

Note that error disappears after variable got error, in other words, after @reloadscript getd() returns a reference.
In conclusion: The getd returns a reference of the variable, but, in this case (with query_sql()), does not occurs. However, when I give @reloadscript the error disappears and the getd() work perfectly.

This post has been edited by Mooka on Aug 12, 2012 23:07

Hercules Elf Bot - Aug 9, 2012 4:41

Originally posted by [b]Xantara[/b]
[b]Fixed [/b]in [rev=16612]

Hercules Elf Bot - Aug 9, 2012 11:00

Originally posted by [b]flaviojs[/b]
@Xantara It's not fixed, you're 'treating' the symptom and creating another breaking point instead. (ex: [i]query_sql[/i] trying to write to a reference to const)

[b]Linking back[/b]: http://eathena.ws/forum/tracker/issue-5084-script-command-getd-doesnt-make-new-names-references-to-variables/

Hercules Elf Bot - Aug 9, 2012 13:21

Originally posted by [b]theultramage[/b]
Also I suggest not going and changing code formatting like that just for the heck of it. You make the actual critical change very hard to see, and create excessive diffs against the parent project.

Hercules Elf Bot - Aug 9, 2012 22:33

Originally posted by [b]Xantara[/b]
Ah, I see. Thanks flaviojs for the explanation and fix.

@theultramage, the code formatting wasn't "just for the heck of it". But, I understand what you're trying to say.

Btw, I suggest fixing your trac. Having to view a red screen saying "The site's security certificate is not trusted!" before proceeding to the actual site is not exactly pleasing to see nor a good thing for a public project. ><;

This post has been edited by Xantara on Aug 9, 2012 22:54

Hercules Elf Bot - Aug 17, 2012 20:54

Originally posted by [b]flaviojs[/b]
Regarding the change in code formatting: if you're following a particular coding style in new/touched code (which seems to be the case), you should document it and put it in the doc folder.

As a side note, that trac is actually for the svn mirror. Google code provides their own change viewer. =~~

This post has been edited by flaviojs on Aug 17, 2012 20:56

Hercules Elf Bot - Nov 11, 2012 1:13

Originally posted by [b]mkbu95[/b]
I couldn't reproduce this. It seems to be working now.