Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Mar 2013 at 16:34 UTC
Updated:
4 Jan 2014 at 02:58 UTC
Jump to comment: Most recent
Comments
Comment #1
arnoldbird commentedYou're still working on the master branch.
Please see the project application checklist: http://drupal.org/node/1587704
In particular please see 2.2 and 4.2 in the checklist.
It looks like you have non-GPL code in the php-sql-parser directory.
Good luck with your project and thanks for submitting.
Comment #2
arnoldbird commentedComment #3
denisz commentedAbout 2.2 - I set up version branch 7.x-1.0
About 2.4 - php-sql-parser library has New BSD License. I'm not quite sure. Is it acceptable if I remove php-sql-parser library from repository and add 3rd party dependence with Libraries API module?
Thank you! Waiting for reply.
Comment #4
arnoldbird commented@denisz -- I'm no expert on the licensing, but I think you have the right idea. If it is non-GPL, you have to remove it from your repo and include instructions for downloading the library in your README or INSTALL files. That's what I would do. I will change this back to "needs work" until you indicate that you have removed the non-GPL code.
Comment #5
denisz commentedI remove php-sql-parser library from repo and add install instruction in README.txt and on project page. So now project has not non-GPL code.
Comment #6
klausiThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxdenisz1939706git
We are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and put yourself on the PAReview: review bonus high priority list. Then I'll take a look at your project right away :-)
Comment #7
denisz commentedAll issues form http://ventral.org/pareview/httpgitdrupalorgsandboxdenisz1939706git are fixed.
Comment #8
arnoldbird commented@denisz
I tried this query...
SELECT users.* FROM users
Your form output...
$query = db_select('users', '');
$query->fields('users', array('*'));
$result = $query->execute();
...I pasted that code into a module file and ran it. I got this PDO error:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS FROM users users' at line 1: SELECT users. AS FROM {users} users; Array ( )
The same MySQL query runs fine if I paste it into the sql form in phpMyAdmin.
What is your use case for this module? Getting something like this to work consistently seems like a very difficult task, so I wonder what your motivation is? How will you use this? Is this module maintainable?
Thank you.
Comment #9
denisz commentedFor now module support only queries with defined aliases for all tables:
If you use this form: "SELECT * FROM users u"
Your will get right result:
$query = db_select('users', 'u');
$query->fields('u');
$result = $query->execute();
I will add information about aliases to project page.
Comment #10
denisz commentedBy the way, now module suppor all queries types (SELECT, UPDATE, INSERT, DELETE).
Also in previous comment I forgot answer the questions:
Q:What is your use case for this module?
Q:How will you use this?
A:Same answer for both questins. This module created for help developers convert SQL queries to Database abstracion layer php code during development process. For me is regular task, when I create query I first wright it in pure SQL syntax, then check if it work and then convert query to php code by hand. This module can automate this convertion porcess. I think this module will be helpful for lot of developers. Also you must not forget, this module not do your work for you, it just help and if some parts of query convert not wirght you can check it by yourself and correct.
Q:Is this module maintainable?
A:Yes, it module maintanable.
Thank you!
Comment #11
denisz commentedAdd "PAReview: review bonus" tag
Comment #12
arnoldbird commentedI suppose that's good enough for me. It's not part of my workflow, but that doesn't mean it isn't part of yours.
Please provide some mention in the README and project page re: which databases the underlying library works with. You could provide one sentence about it, so people immediately understand the module uses a parser that aims to work with numerous databases, but only fully supports MySQL. Just to save someone a minute.
Here is a good example of a README.txt: http://drupal.org/node/1271064
Yours doesn't have to be as long, but you could at least add a bit more information, such as a link to the project page.
The module fails for some queries. I fetched your latest code and re-installed the module. I tried the following query...
INSERT INTO shop VALUES (1,'A',3.45),(1,'B',3.99),(2,'A',10.99),(3,'B',1.45), (3,'C',1.69),(3,'D',1.25),(4,'D',19.95);
The result shown was "INSERT queries not supported now". I think you intend to support insert queries. Anything regarding queries you don't intend to support should probably not be displayed below a heading that says "Results". Another way to display such a message would be to use drupal_set_message(). That might be more appropriate in a case like this. And of course, queries you don't support must be mentioned in the README and project page.
You need to write more tests. For your tests, be sure you are using a wide variety of queries you didn't think of yourself, from places like http://dev.mysql.com/doc/refman/5.0/en/examples.html
It's hard to say how many tests you need for a project like this, but you likely need many more than you've provided.
The module code appears to be quite clean, and it's certainly a difficult task you've set for yourself. But this module has enough remaining issues at this point that removing the bonus tag seems appropriate.
Comment #13
arnoldbird commentedI was wrong about this part. I didn't have the latest version of your module. I see now that the form does output some code for the query, but the code is not correct.
You could also work this query into your tests:
SELECT field1_index, field2_index FROM test_table WHERE field1_index = '1' OR field2_index = '1'At the moment the form isn't handling that query correctly.
Comment #14
denisz commentedHi, arnoldbird. Thank you for your feedback !
About this query
INSERT INTO shop VALUES (1,'A',3.45),(1,'B',3.99),(2,'A',10.99),(3,'B',1.45), (3,'C',1.69),(3,'D',1.25),(4,'D',19.95);I think is not right example, because it shows multiple insertion and also in the README.txt and on project page I specify list of known issues where the first item is "INSERT queries must be specified in form "INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)" ", because cover all possible variants of queries is realy difficult task. So this module cover only most regular using types of queries.
Aboutn this query
SELECT field1_index, field2_index FROM test_table WHERE field1_index = '1' OR field2_index = '1'. It specified in known issues too:"All tables and fields in SELECT query must be specified with aliases, in other (UPDATE, INSERT, DELETE) queries without aliases
Example:
RIGHT: "SELECT * FROM users u"
NOT RIGHT: "SELECT * FROM users" "
If your rewright this query with aliases like this:
SELECT tt.field1_index, tt.field2_index FROM test_table tt WHERE tt.field1_index = '1' OR tt.field2_index = '1'Your will get right result:
Also I update README.txt and add more test with othre variants of queries (UPDATE, INSERT, DELETE).
Comment #15
arnoldbird commentedLooks good to me.
You might consider making the query form smaller. I doubt the textarea needs to be 15 rows. Maybe three or four rows would work?
Given the nature of the module, consider writing more tests. But it's nice that you've already included some.
In step 2 of the installation instructions, you have a typo: "Dwonload..."
Comment #16
arnoldbird commentedOne more minor thing. You should put periods at the end of comments.
Right:
Wrong:
Comment #17
denisz commentedHi, arnoldbird. Thank you again for all your feedback.
I done all small fixes.
About query textarea, I set it to 10 rows, I think it optimal, 3 or 4 rows it to small.
In future I will add more tests. It just start point of this module and I planned to contribute and extand it.
Comment #17.0
denisz commentedAdd project application reviews
Comment #18
klausiRemoving review bonus tag, you have not done all manual reviews, you just posted the output of an automated review tool. Make sure to read through the source code of the other projects.
Comment #18.0
klausiremoved non-manual review.
Comment #19
denisz commentedI just review another one project, so I back "PAReview: review bonus" tag at this point.
Comment #20
klausimanual review:
But that are not blockers, so ...
Thanks for your contribution, denisz!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #21
denisz commentedHi, klausi.
Thank you for your feedback. I will fix all issues from your manual review. And also thank you for helpful links. I will help Drupal community as many as I can.
Comment #22.0
(not verified) commentedAdd one project to "Other project application reviews" section