Case insensitive regular expression filter in MariaDB

2017-11-14 Thread Afshin Mehrabani
Hello,

I have noticed an issue in my local machine and wanted to open a PR but I 
thought it's better to confirm this with you guys first.

I'm using MariaDB and tried to use iregex but noticed that it doesn't work 
at all. After adding `(?i)` to the beginning of the regex, I managed to 
filter the results in a case-insensitive way.

See https://mariadb.com/kb/en/library/pcre/ for more Regex options.

I'm using:

mysql  Ver 15.1 Distrib 10.2.10-MariaDB, for debian-linux-gnu (x86_64) 
> using readline 5.2


Let me know what you think. I can open a PR.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/10348a66-6427-4dbd-b1c6-fb882dc88241%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question: first project can't connect to MySQL

2012-10-04 Thread Afshin Mehrabani
Hey Kevin,

Thanks for your correct reply, I had this problem also but after changing 
host from "localhost" to "127.0.0.1" problem solved, But why? what's the 
different between 'localhost' and '127.0.0.1'? 

On Wednesday, February 4, 2009 9:15:32 PM UTC+3:30, Kevin Audleman wrote:
>
> I found the solution in the archives: I changed DATABASE_HOST to 
> 127.0.0.1 from '' 
>
> Kevin 
>
> On Feb 4, 9:41 am, Kevin Audleman  wrote: 
> > Hello everyone, 
> > 
> > I am running through the tutorial and setting up my first django 
> > project. Quite exciting! However I have run into trouble connecting to 
> > MySQL. My settings.py file looks like this: 
> > 
> > DATABASE_ENGINE = 'mysql'   # 'postgresql_psycopg2', 
> > 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 
> > DATABASE_NAME = 'test' # Or path to database file if using 
> > sqlite3. 
> > DATABASE_USER = 'root' # Not used with sqlite3. 
> > DATABASE_PASSWORD = '' # Not used with sqlite3. 
> > DATABASE_HOST = '' # Set to empty string for localhost. 
> > Not used with sqlite3. 
> > DATABASE_PORT = '' # Set to empty string for default. Not 
> > used with sqlite3. 
> > 
> > Yes, the username is 'root' and there is no password. This is on my 
> > local machine (OS X 10.5) so it doesn't matter. 
> > 
> > When I run... 
> > 
> > $ python manage.py syncdb 
> > 
> > I get the following... 
> > 
> > Traceback (most recent call last): 
> >   File "manage.py", line 11, in  
> > execute_manager(settings) 
> >   File "/Library/Python/2.5/site-packages/django/core/management/ 
> > __init__.py", line 340, in execute_manager 
> > utility.execute() 
> >   File "/Library/Python/2.5/site-packages/django/core/management/ 
> > __init__.py", line 295, in execute 
> > self.fetch_command(subcommand).run_from_argv(self.argv) 
> >   File "/Library/Python/2.5/site-packages/django/core/management/ 
> > base.py", line 192, in run_from_argv 
> > self.execute(*args, **options.__dict__) 
> >   File "/Library/Python/2.5/site-packages/django/core/management/ 
> > base.py", line 218, in execute 
> > self.validate() 
> >   File "/Library/Python/2.5/site-packages/django/core/management/ 
> > base.py", line 246, in validate 
> > num_errors = get_validation_errors(s, app) 
> >   File "/Library/Python/2.5/site-packages/django/core/management/ 
> > validation.py", line 65, in get_validation_errors 
> > connection.validation.validate_field(e, opts, f) 
> >   File "/Library/Python/2.5/site-packages/django/db/backends/mysql/ 
> > validation.py", line 8, in validate_field 
> > db_version = connection.get_server_version() 
> >   File "/Library/Python/2.5/site-packages/django/db/backends/mysql/ 
> > base.py", line 277, in get_server_version 
> > self.cursor() 
> >   File "/Library/Python/2.5/site-packages/django/db/backends/ 
> > __init__.py", line 56, in cursor 
> > cursor = self._cursor(settings) 
> >   File "/Library/Python/2.5/site-packages/django/db/backends/mysql/ 
> > base.py", line 262, in _cursor 
> > self.connection = Database.connect(**kwargs) 
> >   File "/Users/audleman/django_projects/pollster/__init__.py", line 
> > 74, in Connect 
> > 
> >   File "/Library/Python/2.5/site-packages/MySQL_python-1.2.2-py2.5- 
> > macosx-10.5-i386.egg/MySQLdb/connections.py", line 170, in __init__ 
> > _mysql_exceptions.OperationalError: (2002, "Can't connect to local 
> > MySQL server through socket '/tmp/mysql.sock' (2)") 
> > 
> > I'm not exactly sure what this socket is or why django can't find it. 
> > One thought is that I installed LAMP on my machine using XAMPP, which 
> > puts everything in the /Applications/xampp directory. Poking around, I 
> > managed to find a mysql.sock file here: 
> > 
> > /Applications/xampp/xamppfiles/var/mysql/mysql.sock 
> > 
> > Assuming this is the correct socket, how do I tell django where to 
> > find it? 
> > 
> > Thanks, 
> > Kevin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/0dD75LGNe6UJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.