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

World: r3wp

[MySQL]

Will
16-Jun-2007
[917x2]
..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
[956x3]
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
	]
]
you can also use a simple : port: attempt [ open mysql://... ]
Will
27-Jun-2008
[959]
ok but your driver should reconnect automagically 8-)
Dockimbel
27-Jun-2008
[960]
Yes if the server is just restarted, no problem, the driver will 
reconnect.
james_nak
27-Jun-2008
[961]
You rock Doc. Thanks. That was an answer several years in the making!
Maarten
28-Jun-2008
[962x2]
Will, I have, and for Qtask I have even implemented the search protocol 
in REBOL. It's fast.
(i.e. the search client protocol that can talk to Sphinx). You can 
also compile a client in mysql and then use sql for your queries.
Will
1-Jul-2008
[964x3]
Maarten: that is great news! Do you plan on releasing it for the 
rest of us?
would there be any advantage having rebol as an external language 
plugin compared to Dock sheme?

http://forge.mysql.com/wiki/ProjectPage_External_Language_Stored_Procedures
bad question, but it would be cool to program stored procedures in 
rebol