r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[MySQL]

Terry
22-May-2007
[908x2]
Am I missing something wihen querying multiple columns... seems I 
get the results as a single string.. 
ie: send-sql "select a, b from table";

returns something like     "aresultbresult" ?
nevermind
Dockimbel
22-May-2007
[910x2]
Beta release v1.1.1 with a fix for the semicolon issue in SQL strings 
: http://softinnov.org/tmp/mysql-protocol.r
Please let me know if there are still issues with multi-statements 
parsing.
Will
22-May-2007
[912]
Thank you Dock!
Dockimbel
26-May-2007
[913]
Public release of MySQL Driver v.1.1.1 (bugfix release) :

- Multi-statements queries parsing improved. Semi-colons included 
in quoted strings are now ignored.

- Email!, url! and other any-string! values are now correctly escaped 
in prepared statements.

- Empty block! values are now converted to "()" instead of "(NULL)".

http://rebol.softinnov.org/mysql
Will
8-Jun-2007
[914]
need help from mysql gurus ;-)  have this where clause:
WHERE MATCH (data) AGAINST ('"musŽe"' IN BOOLEAN MODE)

now here they say that doublecuoting should make the match accent-sensitive, 
but noo 8-(
http://forums.mysql.com/read.php?107,27969,29346#msg-29346
have set everything utf8 ..
thanks!
Dockimbel
16-Jun-2007
[915]
MySQL driver release v.1.1.2 Download at : http://rebol.softinnov.org/mysql

- Fix for an infinite loop issue when the server times out the connection 
(unix platforms).

- TCP keepalive option activated by default (for longstanding idle 
connections).

- Send-cmd function optimized to be a little bit faster and use less 
memory.
- Added new-lines markers to resulting recorsets.

- Added option to switch on/off new-lines marker through port/locals/newlines? 
flag.

- Recycle call removed from read-rows function. Should speed up the 
results a little bit.
- Minor source code cleanup.
Will
16-Jun-2007
[916x3]
GREAT NEW, a basis benchmark with about 50'000 queries runs in 2:52.26 
minutes and..
..1:37.92 minutes with latest version!
VERY NICE JOB Paul!
Dockimbel
16-Jun-2007
[919]
Thanks, I didn't expected an almost x2 increase in speed! Cool ;-)
amacleod
20-Jun-2007
[920]
Trying to use the new [/flat] option for Doc's diver. If I use: "Insert 
db "SELECT * FROM jobs"I get the expected blocks withing block. But 
if I use the command: "SEND-SQL/FLAT db "SELECT * FROM jobs" I get 
"NONE"
Dockimbel
20-Jun-2007
[921]
does this line return a none! value too : send-sql db "SELECT * FROM 
jobs" ?
amacleod
20-Jun-2007
[922]
That did not work either but I seem to have got it. I had previously 
copyed the database to a word like:  data_info: copy db. But that 
gave me an error saying data_info is a set word.  I changed it to 
data_info: send-sql/flat db "select * from jobs" THis seems to work. 
Thanks
Dockimbel
5-Jul-2007
[923]
MySQL driver bugtracker : http://softinnov.org:8000/curecode/project.rsp?id=5
Oldes
13-Jul-2007
[924x7]
I just found that there is a serious bug in sql-escape functions 
which is part of mysql-protocol...  new versions of MySQL for example 
autoconvert "'" to ' which MUST be escaped or you will get error 
or your query may be injected! Current sql-escape function do not 
escape such a cases.
insert db "create table esctest (text TINYTEXT)"
insert db "insert into esctest values ('a')" ;correct

insert db "insert into esctest values ('a'')" ;=== User Error: 
ERROR 1064
hm... now I see there is some discussion above about injection issues.. 
maybe I'm older version of mysql and this issue is already fixed
now... it's an issue with the latest version as well!
(now = no, I'm = I've....etc.:-)
hmm.. so it's not so bad.. the problem is just with semicolon:

insert db {insert into esctest values ("a;")} ;=== User Error: ERROR 
1064
no... my mistake.. I'm just still using old version... the new one 
is fine:]
Dockimbel
13-Jul-2007
[931]
:-) so, does the driver need to be fixed for "&#039" sequences or 
is it safe let them passed untouched to the server ?
Oldes
13-Jul-2007
[932]
it's safe
Oldes
14-Jul-2007
[933]
I have still some problems with semicolons:-(
Rebolek
14-Jul-2007
[934]
and are you sure you're using latest version? ;o)
Oldes
14-Jul-2007
[935x5]
Version: 1.1.2
Now I'm sure there is something wrong in insert-all-queries function 
as it divides my query where is #";" (but inside data)
and now I have a prove:

not-squote: complement charset "'"
not-dquote: complement charset {"}
ws: charset " ^-^M^/"

data: {INSERT INTO hmm_kalendar_akce VALUES (NULL,9,'posledni-skotsky-kral',NULL,'(Last 
King of Scotland, The)','Poslední skotský král',NULL,NULL,'','http://www.kinoartbrno.cz/?stranka=film&film=posledni-skotsky-kral',0,NULL)}

;the parse part from insert-all-queries function:
	parse/all s: data [
		any [
			#"'" some ["\'" | "''" | not-squote] #"'"
			|{"} some [{\"} | {""} | not-dquote] {"}
			| #"`" thru #"`"
			| e: #";" (
				probe "next query?"
				probe e
			  ) any [ws] s:
			| skip
		]
	]
the problem is with the empty column in the query
there should be:
	#"'" any ["\'" | "''" | not-squote] #"'"
	|{"} any [{\"} | {""} | not-dquote] {"}
Dockimbel
14-Jul-2007
[940]
Thanks for the report, I'm adding your fix in the driver source.
Dockimbel
12-Aug-2007
[941x3]
New MySQL release 1.1.3 beta : http://softinnov.org/tmp/mysql-protocol.r

	o Fix for parsing correctly quoted empty strings. (Fix by Oldes)
		

 o Fixed an issue in case of automatic reconnection, the driver looses 
 local
	  flags like 'flat, auto-ping?, etc...(thanks to Will Arp)


 o Fix a remanence issue on /flat and /raw flags in 'send-sql after
	  automatic reconnection. (thanks to Will Arp)


 o Improved port recovery support after a failed request upon a shutdown 
 server.
	  Now the port will resume working once the server is up again.


 o An init SQL string can now be specified for an opened port. That 
 init string

   will be executed after automatic reconnections. (Useful to set, e.g., 
   a
	  specific charset value). Example : 

		  db-port/locals/init: "SET NAMES 'latin2'"
This new beta fixes mostly auto-reconnection bugs or issues. Please 
test it and report any bugs in CureCode bugtracker and issues here.
MySQL driver bugtracker : http://softinnov.org:8000/curecode/project.rsp?id=5
Oldes
30-Aug-2007
[944x2]
How to connect to DB when I need to use sock ( for example: localhost:/home/hmm/mysql/mysql.sock 
)
hm... already found how to get the correct port number so now it's 
not important
Dockimbel
2-Sep-2007
[946x2]
New MySQL release 1.2.0 beta : http://softinnov.org/tmp/mysql-protocol.r

o Changed behaviour and syntax of the 'read command :

	read mysql://[root-:-localhost]/
	==> return the list of databases

	read mysql://[root-:-localhost]/db
	==> return the list of tables in database "db"

	read mysql://[root-:-localhost]/db/tbl
	==> return the description of table "tbl" in database "db"

	read/custom mysql://[root-:-localhost]/db ["...sql query..."]

 ==> execute the sql query on database "db" and return the resultset.
This new 'read implementation avoids the SQL encoding issues encountered 
in previous versions. The side effect it that it will break compatibility 
with previous sources using 'read.
Will
2-Sep-2007
[948]
Thank you Dock!
[unknown: 5]
2-Sep-2007
[949]
Congrats Doc.
Dockimbel
3-Oct-2007
[950]
MySQL driver release v.1.2.0 - Download at : http://rebol.softinnov.org/mysql
- Changed behaviour and syntax of the READ function.
- Fix for parsing correctly quoted empty strings. (Fix by Oldes)

- Fix for the driver loosing local flags, like 'flat, 'auto-ping?,... 
when reconnecting (thanks to Will Arp)

- Fix a remanence issue on /flat and /raw flags in 'send-sql after 
automatic reconnection. (thanks to Will Arp)

- Improved port recovery support after a failed request upon a shutdown 
server.
- An init SQL string can now be specified for an opened port.
james_nak
3-Oct-2007
[951]
Doc, first of all, thanks for the driver. It is amazing. Secondly, 
I've tried a few ways to be able to detect for an open port without 
the program erroring out. I've just settled on a "error? attempt 
[db/locals]" Do you have any recommendations?
Will
22-Mar-2008
[952]
some nice performance tips http://www.scribd.com/doc/393792/MySQL-performance-coding
Will
17-Apr-2008
[953]
http://developers.slashdot.org/article.pl?sid=08/04/16/2337224long 
life postgresql 8)
BrianH
17-Apr-2008
[954]
Read the comments: The CEO of MySQL sets the story straight.
Will
13-Jun-2008
[955]
Does anyone experimented with the sphinx search engine? http://www.sphinxsearch.com/
Dockimbel
27-Jun-2008
[956x2]
Here's a handy function to test if a MySQL server is up :
mysql-alive?: func [/host ip /port n /local p][
	either attempt [
		p: open/direct/no-wait join tcp:// [
			either host [ip][127.0.0.1]
			#":"
			either port [n][3306]
		]
	][
		close p
		yes
	][
		no
	]
]